diff options
author | Junio C Hamano <junkio@cox.net> | 2005-11-09 18:54:14 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-11-09 18:54:14 -0800 |
commit | 13956670a7baf4b3b794a2cc799bd501753f1746 (patch) | |
tree | 062177e5c6e31c9a9ddabb9066fd0331c2004f42 /git-merge.sh | |
parent | a489352e3d1d861237729385f9afc5950bcfa6a0 (diff) | |
download | git-13956670a7baf4b3b794a2cc799bd501753f1746.tar.gz git-13956670a7baf4b3b794a2cc799bd501753f1746.tar.xz |
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>
Diffstat (limited to 'git-merge.sh')
-rwxr-xr-x | git-merge.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/git-merge.sh b/git-merge.sh index b810fceaf..7f481e4ca 100755 --- a/git-merge.sh +++ b/git-merge.sh @@ -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 @@ -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 |