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:
authorJunio C Hamano <gitster@pobox.com>2018-07-18 22:20:32 +0300
committerJunio C Hamano <gitster@pobox.com>2018-07-18 22:20:32 +0300
commit676c7e50b10f1fbb2ce06e46260f15f3a20679f7 (patch)
treeefc43befda409ef7c1faa60789397c352670aa98 /t/t7003-filter-branch.sh
parent36b37afda6487113a981b036431fa97aa3fe2234 (diff)
parent709cfe848ad2312f80e6f4f7a27aa5d23992a0e3 (diff)
Merge branch 'mb/filter-branch-optim'
"git filter-branch" when used with the "--state-branch" option still attempted to rewrite the commits whose filtered result is known from the previous attempt (which is recorded on the state branch); the command has been corrected not to waste cycles doing so. * mb/filter-branch-optim: filter-branch: skip commits present on --state-branch
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 ec4b160ddb..e23de7d0b5 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 &&