Skip to content

Commit 579c9bb

Browse files
spearceJunio C Hamano
authored andcommitted
Use merge-recursive in git-am -3.
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>
1 parent a970e84 commit 579c9bb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

git-am.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,20 @@ It does not apply to blobs recorded in its index."
8888
# This is not so wrong. Depending on which base we picked,
8989
# orig_tree may be wildly different from ours, but his_tree
9090
# has the same set of wildly different changes in parts the
91-
# patch did not touch, so resolve ends up canceling them,
91+
# patch did not touch, so recursive ends up canceling them,
9292
# saying that we reverted all those changes.
9393

94-
git-merge-resolve $orig_tree -- HEAD $his_tree || {
94+
eval GITHEAD_$his_tree='"$SUBJECT"'
95+
export GITHEAD_$his_tree
96+
git-merge-recursive $orig_tree -- HEAD $his_tree || {
9597
if test -d "$GIT_DIR/rr-cache"
9698
then
9799
git-rerere
98100
fi
99101
echo Failed to merge in the changes.
100102
exit 1
101103
}
104+
unset GITHEAD_$his_tree
102105
}
103106

104107
prec=4

0 commit comments

Comments
 (0)