aboutsummaryrefslogtreecommitdiff
path: root/git-am.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-10-13 11:46:43 -0700
committerJunio C Hamano <junkio@cox.net>2005-10-13 11:46:43 -0700
commit73319032c8d2b2c73138d5caee1d2838fe1305d2 (patch)
treeb66dab45d46cde41f3d4e365faf03c405d0e6c3f /git-am.sh
parent8af12741ee0e35f43b3180b435cd33642c183e97 (diff)
downloadgit-73319032c8d2b2c73138d5caee1d2838fe1305d2.tar.gz
git-73319032c8d2b2c73138d5caee1d2838fe1305d2.tar.xz
git-am: do not fail if 3-way fallback succeeds.
The current one incorrectly stops there without committing. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-am.sh')
-rwxr-xr-xgit-am.sh20
1 files changed, 12 insertions, 8 deletions
diff --git a/git-am.sh b/git-am.sh
index 85d682669..c562159a1 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -296,15 +296,19 @@ do
git-apply --index "$dotest/patch"; apply_status=$?
if test $apply_status = 1 && test "$threeway" = t
then
- (fall_back_3way) || stop_here $this
-
- # Applying the patch to an earlier tree and merging the
- # result may have produced the same tree as ours.
- if test '' = "$(git-diff-index --cached --name-only -z HEAD)"
+ if (fall_back_3way)
then
- echo No changes -- Patch already applied.
- go_next
- continue
+ # Applying the patch to an earlier tree and merging the
+ # result may have produced the same tree as ours.
+ changed="$(git-diff-index --cached --name-only -z HEAD)"
+ if test '' = "$changed"
+ then
+ echo No changes -- Patch already applied.
+ go_next
+ continue
+ fi
+ # clear apply_status -- we have successfully merged.
+ apply_status=0
fi
fi
if test $apply_status != 0