X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7003-filter-branch.sh;h=b0a9d7d536314ec842b141c09ba0d6f8b06b6288;hb=fdfb4cfadcfdfe4ebafd0545b5ebb661433ea66c;hp=182aea4267c33fd0f737c9028cedcb635e3348e2;hpb=1b118da8bd1878d78589afd9f755b9d52a9579ad;p=git.git diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index 182aea426..b0a9d7d53 100755 --- a/t/t7003-filter-branch.sh +++ b/t/t7003-filter-branch.sh @@ -96,13 +96,17 @@ test_expect_success 'filter subdirectory only' ' test_tick && git commit -m "again not subdir" && git branch sub && - git filter-branch -f --subdirectory-filter subdir refs/heads/sub + git branch sub-earlier HEAD~2 && + git filter-branch -f --subdirectory-filter subdir \ + refs/heads/sub refs/heads/sub-earlier ' test_expect_success 'subdirectory filter result looks okay' ' test 2 = $(git rev-list sub | wc -l) && git show sub:new && - test_must_fail git show sub:subdir + test_must_fail git show sub:subdir && + git show sub-earlier:new && + test_must_fail git show sub-earlier:subdir ' test_expect_success 'more setup' ' @@ -250,4 +254,12 @@ test_expect_success 'Tag name filtering strips gpg signature' ' test_cmp expect actual ' +test_expect_success 'Tag name filtering allows slashes in tag names' ' + git tag -m tag-with-slash X/1 && + git cat-file tag X/1 | sed -e s,X/1,X/2, > expect && + git filter-branch -f --tag-name-filter "echo X/2" && + git cat-file tag X/2 > actual && + test_cmp expect actual +' + test_done