Skip to content

Commit

Permalink
am: refresh the index at start and --resolved
Browse files Browse the repository at this point in the history
If a file is unchanged but stat-dirty, we may erroneously
fail to apply patches, thinking that they conflict with a
dirty working tree.

This patch adds a call to "update-index --refresh". It comes
as late as possible, so that we don't bother with it for
thinks like "git rebase --abort", or when mbox-splitting
fails. However, it does come before we actually start
applying patches, meaning we will only call it once when we
start applying patches (or any time we return to "am" after
having resolved conflicts), and not once per patch.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Aug 16, 2011
1 parent 0906f6e commit 2a6f08a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions git-am.sh
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,8 @@ else
fi
fi

git update-index -q --refresh

case "$resolved" in
'')
case "$HAS_HEAD" in
Expand Down

0 comments on commit 2a6f08a

Please sign in to comment.