Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Barabanov <michael.barabanov@gmail.com>2018-06-26 07:07:33 +0300
committerJunio C Hamano <gitster@pobox.com>2018-06-27 01:44:53 +0300
commit709cfe848ad2312f80e6f4f7a27aa5d23992a0e3 (patch)
treecf3aea0991e10ca1bc2fd058b2b49a98e454056c /t/t7003-filter-branch.sh
parentfc54c1af3ec09bab8b8ea09768c2da4069b7f53e (diff)
filter-branch: skip commits present on --state-branch
The commits in state:filter.map have already been processed, so don't filter them again. This makes incremental git filter-branch much faster. Also add tests for --state-branch option. Signed-off-by: Michael Barabanov <michael.barabanov@gmail.com> Acked-by: Ian Campbell <ijc@hellion.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7003-filter-branch.sh')
-rwxr-xr-xt/t7003-filter-branch.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 7cb60799be..451211280b 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -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 &&