X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=update-index.c;h=797245ab276543edc5d7605b57f5175278436234;hb=20b1d700c94c8b5b2b8b6f1b4982858d03cd9453;hp=bb730509b871381ffbd8457bd38ce940d78ba50d;hpb=9a9d58520d255c54c3ca1f60eefe0bfedcab0164;p=git.git diff --git a/update-index.c b/update-index.c index bb730509..797245ab 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); @@ -572,9 +577,11 @@ int main(int argc, const char **argv) break; } if (!strcmp(path, "--index-info")) { + if (i != argc - 1) + die("--index-info must be at the end"); allow_add = allow_replace = allow_remove = 1; read_index_info(line_termination); - continue; + break; } if (!strcmp(path, "--ignore-missing")) { not_new = 1;