]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/t7003-filter-branch.sh
git-fetch test: test tracking fetch results, not just FETCH_HEAD
[git.git] / t / t7003-filter-branch.sh
index 5f60b22d872b5d034e137e0c6c7c5a9d664e57ee..6e14bf1c7f0991bbaab217e8a08bae0cacfe1ab1 100755 (executable)
@@ -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