summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--update-index.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/update-index.c b/update-index.c
index bb730509b8..ce1db38d16 100644
--- a/update-index.c
+++ b/update-index.c
@@ -161,8 +161,13 @@ static struct cache_entry *refresh_entry(struct cache_entry *ce, int really)
return ERR_PTR(-errno);
changed = ce_match_stat(ce, &st, really);
- if (!changed)
- return NULL;
+ if (!changed) {
+ if (really && assume_unchanged &&
+ !(ce->ce_flags & htons(CE_VALID)))
+ ; /* mark this one VALID again */
+ else
+ return NULL;
+ }
if (ce_modified(ce, &st, really))
return ERR_PTR(-EINVAL);