3 # Copyright (c) 2005 Linus Torvalds
4 # Copyright (c) 2005 Junio C Hamano
6 # Resolve two trees, using enhanced multi-base read-tree.
10 # Abort if index does not match HEAD
11 if ! git diff-index
--quiet --cached HEAD
--
13 gettextln
"Error: Your local changes to the following files would be overwritten by merge"
14 git diff-index
--cached --name-only HEAD
-- |
sed -e 's/^/ /'
18 # The first parameters up to -- are merge bases; the rest are heads.
19 bases
= head= remotes
= sep_seen
=
22 case ",$sep_seen,$head,$arg," in
30 remotes
="$remotes$arg "
38 # Give up if we are given two or more remotes -- not handling octopus.
44 # Give up if this is a baseless merge.
50 git update-index
-q --refresh
51 git read-tree
-u -m --aggressive $bases $head $remotes ||
exit 2
52 echo "Trying simple merge."
53 if result_tree
=$
(git write-tree
2>/dev
/null
)
57 echo "Simple merge failed, trying Automatic merge."
58 if git merge-index
-o git-merge-one-file
-a