Skip to content

Commit

Permalink
git-am: do not fail if 3-way fallback succeeds.
Browse files Browse the repository at this point in the history
The current one incorrectly stops there without committing.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Oct 13, 2005
1 parent 8af1274 commit 7331903
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions git-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7331903

Please sign in to comment.