@matheusbsbs / matheus-bagliano / commits / 13956670a7
Fork 0

Use 'merge-base --all' where applicable.

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>

Junio C Hamano committed Nov 9, 2005 at 18:54 UTC 13956670a7baf4b3b794a2cc799bd501753f1746
1 file changed +9 -2
git-merge.sh
+9 -2
@@ -110,7 +110,14 @@ do
110 die "$remote - not something we can merge"
111 done
112
113 -common=$(git-show-branch --merge-base $head "$@")
113 +case "$#" in
114 +1)
115 + common=$(git-merge-base --all $head "$@")
116 + ;;
117 +*)
118 + common=$(git-show-branch --merge-base $head "$@")
119 + ;;
120 +esac
121 echo "$head" >"$GIT_DIR/ORIG_HEAD"
122
123 case "$#,$common,$no_commit" in
@@ -162,7 +169,7 @@ case "$#,$common,$no_commit" in
169 up_to_date=t
170 for remote
171 do
165 - common_one=$(git-merge-base $head $remote)
172 + common_one=$(git-merge-base --all $head $remote)
173 if test "$common_one" != "$remote"
174 then
175 up_to_date=f