Skip to content

Commit 2a6f08a

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0906f6e commit 2a6f08a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

git-am.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,8 @@ else
507507
fi
508508
fi
509509

510+
git update-index -q --refresh
511+
510512
case "$resolved" in
511513
'')
512514
case "$HAS_HEAD" in

0 commit comments

Comments
 (0)