aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-04-02 11:13:23 -0700
committerJunio C Hamano <gitster@pobox.com>2008-04-02 11:13:23 -0700
commiteedb9d9eabda4d6a91f2271b8694763d018b0f89 (patch)
tree8260efd6c98ff804f1cfb75feb01e1be635a9a6c /t
parentcfc4ba33e3cc95a30cb808eec1b54b52450c3bdf (diff)
parent6a589fda2e4759e21d66eb2e6814e32baa14beca (diff)
downloadgit-eedb9d9eabda4d6a91f2271b8694763d018b0f89.tar.gz
git-eedb9d9eabda4d6a91f2271b8694763d018b0f89.tar.xz
Merge branch 'js/filter-branch'
* js/filter-branch: filter-branch: Fix renaming a directory in the tree-filter filter-branch: Test renaming directories in a tree-filter
Diffstat (limited to 't')
-rwxr-xr-xt/t7003-filter-branch.sh20
1 files changed, 18 insertions, 2 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 6827249da..efd658adb 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -17,6 +17,8 @@ test_expect_success 'setup' '
make_commit B
git checkout -b branch B
make_commit D
+ mkdir dir
+ make_commit dir/D
make_commit E
git checkout master
make_commit C
@@ -41,9 +43,23 @@ test_expect_success 'rewrite, renaming a specific file' '
'
test_expect_success 'test that the file was renamed' '
- test d = $(git show HEAD:doh) &&
+ test d = "$(git show HEAD:doh --)" &&
+ ! test -f d &&
test -f doh &&
- test d = $(cat doh)
+ test d = "$(cat doh)"
+'
+
+test_expect_success 'rewrite, renaming a specific directory' '
+ git-filter-branch -f --tree-filter "mv dir diroh || :" HEAD
+'
+
+test_expect_success 'test that the directory was renamed' '
+ test dir/d = "$(git show HEAD:diroh/d --)" &&
+ ! test -d dir &&
+ test -d diroh &&
+ ! test -d diroh/dir &&
+ test -f diroh/d &&
+ test dir/d = "$(cat diroh/d)"
'
git tag oldD HEAD~4