summaryrefslogtreecommitdiff
path: root/git-rebase--merge.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-05-06 14:45:44 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-05-06 14:45:44 -0700
commit89d3eafe9019b407d6b2cf8913c6845bde50b178 (patch)
treefcfdaf135f8c67c35f093048e6d6b35e4caa883a /git-rebase--merge.sh
parentMerge branch 'jc/drop-git-spec-in' (diff)
parentgit-rebase--merge: don't include absent parent as a base (diff)
downloadtgif-89d3eafe9019b407d6b2cf8913c6845bde50b178.tar.xz
Merge branch 'bw/rebase-merge-entire-branch'
"git rebase -m" could be asked to rebase an entire branch starting from the root, but failed by assuming that there always is a parent commit to the first commit on the branch. * bw/rebase-merge-entire-branch: git-rebase--merge: don't include absent parent as a base
Diffstat (limited to 'git-rebase--merge.sh')
-rw-r--r--git-rebase--merge.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-rebase--merge.sh b/git-rebase--merge.sh
index 2cc2a6d273..8d43db9069 100644
--- a/git-rebase--merge.sh
+++ b/git-rebase--merge.sh
@@ -67,7 +67,9 @@ call_merge () {
GIT_MERGE_VERBOSITY=1 && export GIT_MERGE_VERBOSITY
fi
test -z "$strategy" && strategy=recursive
- eval 'git-merge-$strategy' $strategy_opts '"$cmt^" -- "$hd" "$cmt"'
+ # If cmt doesn't have a parent, don't include it as a base
+ base=$(git rev-parse --verify --quiet $cmt^)
+ eval 'git-merge-$strategy' $strategy_opts $base ' -- "$hd" "$cmt"'
rv=$?
case "$rv" in
0)