Code

Merge branch 'jc/hide-cr-in-diff-from-less'
[git.git] / t / t7003-filter-branch.sh
index 182aea4267c33fd0f737c9028cedcb635e3348e2..b0a9d7d536314ec842b141c09ba0d6f8b06b6288 100755 (executable)
@@ -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