summaryrefslogtreecommitdiff
path: root/t/t7003-filter-branch.sh
diff options
context:
space:
mode:
authorveillette@yahoo.ca <veillette@yahoo.ca>2008-03-31 07:14:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-03-31 08:09:50 (GMT)
commit6a589fda2e4759e21d66eb2e6814e32baa14beca (patch)
treea9390a25e666eba12681ded584df47408ee731c0 /t/t7003-filter-branch.sh
parent90356287e65181caeaa821d7476b8865d26bc588 (diff)
downloadgit-6a589fda2e4759e21d66eb2e6814e32baa14beca.zip
git-6a589fda2e4759e21d66eb2e6814e32baa14beca.tar.gz
git-6a589fda2e4759e21d66eb2e6814e32baa14beca.tar.bz2
filter-branch: Fix renaming a directory in the tree-filter
Commit d89c1df (filter-branch: don't use xargs -0, 2008-03-12) replaced a 'ls-files | xargs rm' pipeline by 'git clean'. 'git clean' however does not recurse and remove directories by default. Now, consider a tree-filter that renames a directory. 1. For the first commit everything works as expected 2. Then filter-branch checks out the files for the next commit. This leaves the new directory behind because there is no real "branch switching" involved that would notice that the directory can be removed. 3. Then filter-branch invokes 'git clean' to remove exactly those left-overs. But here it does not remove the directory. 4. The next tree-filter does not work as expected because there already exists a directory with the new name. Just add -d to 'git clean', so that empty directories are removed. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7003-filter-branch.sh')
-rwxr-xr-xt/t7003-filter-branch.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 53b5ce6..efd658a 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -53,7 +53,7 @@ test_expect_success 'rewrite, renaming a specific directory' '
git-filter-branch -f --tree-filter "mv dir diroh || :" HEAD
'
-test_expect_failure 'test that the directory was renamed' '
+test_expect_success 'test that the directory was renamed' '
test dir/d = "$(git show HEAD:diroh/d --)" &&
! test -d dir &&
test -d diroh &&