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>
Thomas Rast committed
Aug 12, 2008 at 10:45 UTC
6e84b712373d343ea3531740d8eb048e84240a39
1 file changed
+7
-3
t/t7003-filter-branch.sh
+7
-3
@@ -96,13 +96,17 @@ test_expect_success 'filter subdirectory only' '
96
test_tick &&
97
git commit -m "again not subdir" &&
98
git branch sub &&
99
- git-filter-branch -f --subdirectory-filter subdir refs/heads/sub
99
+ git branch sub-earlier HEAD~2 &&
100
+ git-filter-branch -f --subdirectory-filter subdir \
101
+ refs/heads/sub refs/heads/sub-earlier
102
'
103
102
-test_expect_success 'subdirectory filter result looks okay' '
104
+test_expect_failure 'subdirectory filter result looks okay' '
105
test 2 = $(git rev-list sub | wc -l) &&
106
git show sub:new &&
105
- test_must_fail git show sub:subdir
107
+ test_must_fail git show sub:subdir &&
108
+ git show sub-earlier:new &&
109
+ test_must_fail git show sub-earlier:subdir
110
'
111
112
test_expect_success 'more setup' '