Skip to content

Commit b92b2ce

Browse files
author
Junio C Hamano
committed
"Assume unchanged" git: --really-refresh fix.
The earlier round failed to make --really-refresh to mark up-to-date index entry to valid again due to a trivial thinko. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 2bcab24 commit b92b2ce

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

update-index.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,13 @@ static struct cache_entry *refresh_entry(struct cache_entry *ce, int really)
161161
return ERR_PTR(-errno);
162162

163163
changed = ce_match_stat(ce, &st, really);
164-
if (!changed)
165-
return NULL;
164+
if (!changed) {
165+
if (really && assume_unchanged &&
166+
!(ce->ce_flags & htons(CE_VALID)))
167+
; /* mark this one VALID again */
168+
else
169+
return NULL;
170+
}
166171

167172
if (ce_modified(ce, &st, really))
168173
return ERR_PTR(-EINVAL);

0 commit comments

Comments
 (0)