Skip to content

Commit

Permalink
Use 'merge-base --all' where applicable.
Browse files Browse the repository at this point in the history
It may get extra merge base on truly pathological commit histories,
but is a lot easier to understand, explain, and prove correctness.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Nov 10, 2005
1 parent a489352 commit 1395667
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions git-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,14 @@ do
die "$remote - not something we can merge"
done

common=$(git-show-branch --merge-base $head "$@")
case "$#" in
1)
common=$(git-merge-base --all $head "$@")
;;
*)
common=$(git-show-branch --merge-base $head "$@")
;;
esac
echo "$head" >"$GIT_DIR/ORIG_HEAD"

case "$#,$common,$no_commit" in
Expand Down Expand Up @@ -162,7 +169,7 @@ case "$#,$common,$no_commit" in
up_to_date=t
for remote
do
common_one=$(git-merge-base $head $remote)
common_one=$(git-merge-base --all $head $remote)
if test "$common_one" != "$remote"
then
up_to_date=f
Expand Down

0 comments on commit 1395667

Please sign in to comment.