Skip to content

Commit

Permalink
Use merge-recursive in git-am -3.
Browse files Browse the repository at this point in the history
By switching from merge-resolve to merge-recursive in the 3-way
fallback behavior of git-am we gain a few benefits:

 * renames are automatically handled, like in rebase -m;
 * conflict hunks can reference the patch name;
 * its faster on Cygwin (less forks).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
spearce authored and Junio C Hamano committed Dec 29, 2006
1 parent a970e84 commit 579c9bb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions git-am.sh
Expand Up @@ -88,17 +88,20 @@ It does not apply to blobs recorded in its index."
# This is not so wrong. Depending on which base we picked,
# orig_tree may be wildly different from ours, but his_tree
# has the same set of wildly different changes in parts the
# patch did not touch, so resolve ends up canceling them,
# patch did not touch, so recursive ends up canceling them,
# saying that we reverted all those changes.

git-merge-resolve $orig_tree -- HEAD $his_tree || {
eval GITHEAD_$his_tree='"$SUBJECT"'
export GITHEAD_$his_tree
git-merge-recursive $orig_tree -- HEAD $his_tree || {
if test -d "$GIT_DIR/rr-cache"
then
git-rerere
fi
echo Failed to merge in the changes.
exit 1
}
unset GITHEAD_$his_tree
}

prec=4
Expand Down

0 comments on commit 579c9bb

Please sign in to comment.