summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2008-08-12 08:45:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-08-13 00:27:07 (GMT)
commit6e84b712373d343ea3531740d8eb048e84240a39 (patch)
tree99c5f19b305236a74e3d11ebab5f6a06eaa03955
parent04c6e9e9ca34226db095bbaa1218030f99f0b7c6 (diff)
downloadgit-6e84b712373d343ea3531740d8eb048e84240a39.zip
git-6e84b712373d343ea3531740d8eb048e84240a39.tar.gz
git-6e84b712373d343ea3531740d8eb048e84240a39.tar.bz2
filter-branch: Extend test to show rewriting bug
This extends the --subdirectory-filter test in t7003 to demonstrate a rewriting bug: when rewriting two refs A and B such that B is an ancestor of A, it fails to rewrite B. The underlying issue is that the rev-list invocation at git-filter-branch.sh:332 more or less boils down to git rev-list B --boundary ^A which outputs nothing because B is an ancestor of A. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t7003-filter-branch.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index a0ab096..4382baa 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -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_expect_failure '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' '