From: Jeff King Date: Tue, 16 Aug 2011 00:13:07 +0000 (-0700) Subject: am: refresh the index at start and --resolved X-Git-Tag: v1.7.6.1~34 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2a6f08ac1f6949ed0072aed3240bc04d80051851;p=git.git am: refresh the index at start and --resolved 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 Signed-off-by: Junio C Hamano --- diff --git a/git-am.sh b/git-am.sh index 6cdd5910d..f1a03c912 100755 --- a/git-am.sh +++ b/git-am.sh @@ -507,6 +507,8 @@ else fi fi +git update-index -q --refresh + case "$resolved" in '') case "$HAS_HEAD" in