return error("Cannot do a oneway merge of %d trees",
merge_size);
- if (!a)
+ if (!a) {
+ invalidate_ce_path(old);
return deleted_entry(old, NULL);
+ }
if (old && same(old, a)) {
- struct stat st;
- if (lstat(old->name, &st) || ce_match_stat(old, &st, 1))
- old->ce_flags |= htons(CE_UPDATE);
+ if (reset) {
+ struct stat st;
+ if (lstat(old->name, &st) ||
+ ce_match_stat(old, &st, 1))
+ old->ce_flags |= htons(CE_UPDATE);
+ }
return keep_entry(old);
}
return merged_entry(a, NULL);