From bb3f45838b859c8b17a53a24579a304333868cc8 Mon Sep 17 00:00:00 2001 From: John Keeping Date: Thu, 9 Jan 2014 19:47:34 +0000 Subject: 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 Signed-off-by: John Keeping Signed-off-by: Junio C Hamano --- git-rebase.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'git-rebase.sh') diff --git a/git-rebase.sh b/git-rebase.sh index 7185dc8438..8a3efa2983 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -534,7 +534,8 @@ esac if test "$fork_point" = t then - new_upstream=$(git merge-base --fork-point "$upstream_name" "$switch_to") + new_upstream=$(git merge-base --fork-point "$upstream_name" \ + "${switch_to:-HEAD}") if test -n "$new_upstream" then upstream=$new_upstream -- cgit v1.2.1