Skip to content

Commit 3ddd170

Browse files
bebarinogitster
authored andcommitted
am: suppress apply errors when using 3-way
git-am with 3-way outputs errors when applying, even though the 3-way will usually be successful. We suppress these errors from git-apply because they are not "true" errors until the 3-way has been attempted. Signed-off-by: Stephen Boyd <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b3c32ea commit 3ddd170

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

git-am.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,14 @@ do
502502

503503
case "$resolved" in
504504
'')
505-
eval 'git apply '"$git_apply_opt"' --index "$dotest/patch"'
505+
# When we are allowed to fall back to 3-way later, don't give
506+
# false errors during the initial attempt.
507+
squelch=
508+
if test "$threeway" = t
509+
then
510+
squelch='>/dev/null 2>&1 '
511+
fi
512+
eval "git apply $squelch$git_apply_opt"' --index "$dotest/patch"'
506513
apply_status=$?
507514
;;
508515
t)

0 commit comments

Comments
 (0)