]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t7003-filter-branch.sh
path.c: don't call the match function without value in trie_find()
[thirdparty/git.git] / t / t7003-filter-branch.sh
index ec4b160ddb9f966044e729f35cc1edfcc79eed14..e23de7d0b5a4da29effb1e59426f857fed0e91e0 100755 (executable)
@@ -107,6 +107,21 @@ test_expect_success 'test that the directory was renamed' '
        test dir/D = "$(cat diroh/D.t)"
 '
 
+V=$(git rev-parse HEAD)
+
+test_expect_success 'populate --state-branch' '
+       git filter-branch --state-branch state -f --tree-filter "touch file || :" HEAD
+'
+
+W=$(git rev-parse HEAD)
+
+test_expect_success 'using --state-branch to skip already rewritten commits' '
+       test_when_finished git reset --hard $V &&
+       git reset --hard $V &&
+       git filter-branch --state-branch state -f --tree-filter "touch file || :" HEAD &&
+       test_cmp_rev $W HEAD
+'
+
 git tag oldD HEAD~4
 test_expect_success 'rewrite one branch, keeping a side branch' '
        git branch modD oldD &&