summaryrefslogtreecommitdiff
path: root/t/t3400-rebase.sh
diff options
context:
space:
mode:
authorJohn Keeping <john@keeping.me.uk>2014-01-09 19:47:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-01-09 23:05:26 (GMT)
commitbb3f45838b859c8b17a53a24579a304333868cc8 (patch)
treec8f5a088eb941d1c92a288cde504e52b2504e9d3 /t/t3400-rebase.sh
parentad8261d21221d27638c75f47b39892db6f7972f6 (diff)
downloadgit-bb3f45838b859c8b17a53a24579a304333868cc8.zip
git-bb3f45838b859c8b17a53a24579a304333868cc8.tar.gz
git-bb3f45838b859c8b17a53a24579a304333868cc8.tar.bz2
rebase: fix fork-point with zero arguments
When no arguments are specified, $switch_to is empty so we end up passing the empty string to "git merge-base --fork-point", which causes an error. git-rebase carries on at this point, but in fact we have failed to apply the fork-point operation. It turns out that the test in t3400 that was meant to test this didn't actually need the fork-point behaviour, so enhance it to make sure that the fork-point is applied correctly. The modified test fails without the change to git-rebase.sh in this patch. Reported-by: Andreas Krey <a.krey@gmx.de> Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3400-rebase.sh')
-rwxr-xr-xt/t3400-rebase.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index 998503d..6d94b1f 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -135,11 +135,19 @@ test_expect_success 'fail when upstream arg is missing and not configured' '
'
test_expect_success 'default to common base in @{upstream}s reflog if no upstream arg' '
+ git checkout -b default-base master &&
git checkout -b default topic &&
git config branch.default.remote . &&
- git config branch.default.merge refs/heads/master &&
+ git config branch.default.merge refs/heads/default-base &&
git rebase &&
- git rev-parse --verify master >expect &&
+ git rev-parse --verify default-base >expect &&
+ git rev-parse default~1 >actual &&
+ test_cmp expect actual &&
+ git checkout default-base &&
+ git reset --hard HEAD^ &&
+ git checkout default &&
+ git rebase &&
+ git rev-parse --verify default-base >expect &&
git rev-parse default~1 >actual &&
test_cmp expect actual
'