]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/t7003-filter-branch.sh
Merge branch 'jc/makefile'
[git.git] / t / t7003-filter-branch.sh
index 5f60b22d872b5d034e137e0c6c7c5a9d664e57ee..553131fcf4cc418309e0cb750d885a5fbfe0fe47 100755 (executable)
@@ -4,7 +4,7 @@ test_description='git-filter-branch'
 . ./test-lib.sh
 
 make_commit () {
-       lower=$(echo $1 | tr A-Z a-z)
+       lower=$(echo $1 | tr '[A-Z]' '[a-z]')
        echo $lower > $lower
        git add $lower
        test_tick
@@ -165,4 +165,42 @@ test_expect_success '"map" works in commit filter' '
        git rev-parse --verify master
 '
 
+test_expect_success 'Name needing quotes' '
+
+       git checkout -b rerere A &&
+       mkdir foo &&
+       name="れれれ" &&
+       >foo/$name &&
+       git add foo &&
+       git commit -m "Adding a file" &&
+       git filter-branch --tree-filter "rm -fr foo" &&
+       ! git ls-files --error-unmatch "foo/$name" &&
+       test $(git rev-parse --verify rerere) != $(git rev-parse --verify A)
+
+'
+
+test_expect_success 'Subdirectory filter with disappearing trees' '
+       git reset --hard &&
+       git checkout master &&
+
+       mkdir foo &&
+       touch foo/bar &&
+       git add foo &&
+       test_tick &&
+       git commit -m "Adding foo" &&
+
+       git rm -r foo &&
+       test_tick &&
+       git commit -m "Removing foo" &&
+
+       mkdir foo &&
+       touch foo/bar &&
+       git add foo &&
+       test_tick &&
+       git commit -m "Re-adding foo" &&
+
+       git filter-branch -f --subdirectory-filter foo &&
+       test $(git rev-list master | wc -l) = 3
+'
+
 test_done