projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
git-apply: safety fixes
[git.git]
/
update-index.c
diff --git
a/update-index.c
b/update-index.c
index
bb73050
..
797245a
100644
(file)
--- 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);
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);
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")) {
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);
allow_add = allow_replace = allow_remove = 1;
read_index_info(line_termination);
-
continue
;
+
break
;
}
if (!strcmp(path, "--ignore-missing")) {
not_new = 1;
}
if (!strcmp(path, "--ignore-missing")) {
not_new = 1;