@matheusbsbs / matheus-bagliano / commits / 579c9bb198
Fork 0

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>

Shawn O. Pearce committed Dec 28, 2006 at 02:35 UTC 579c9bb1986005282e049c6ad8f594a1ffc35fba
1 file changed +5 -2
git-am.sh
+5 -2
@@ -88,10 +88,12 @@ It does not apply to blobs recorded in its index."
88 # This is not so wrong. Depending on which base we picked,
89 # orig_tree may be wildly different from ours, but his_tree
90 # 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,
92 # saying that we reverted all those changes.
93
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 || {
97 if test -d "$GIT_DIR/rr-cache"
98 then
99 git-rerere
@@ -99,6 +101,7 @@ It does not apply to blobs recorded in its index."
101 echo Failed to merge in the changes.
102 exit 1
103 }
104 + unset GITHEAD_$his_tree
105 }
106
107 prec=4