"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>
maint
Junio C Hamano 2006-02-09 00:55:17 -08:00
parent 2bcab24080
commit b92b2ce94e
1 changed files with 7 additions and 2 deletions

View File

@ -161,8 +161,13 @@ static struct cache_entry *refresh_entry(struct cache_entry *ce, int really)
return ERR_PTR(-errno); return ERR_PTR(-errno);


changed = ce_match_stat(ce, &st, really); changed = ce_match_stat(ce, &st, really);
if (!changed) if (!changed) {
return NULL; if (really && assume_unchanged &&
!(ce->ce_flags & htons(CE_VALID)))
; /* mark this one VALID again */
else
return NULL;
}


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