Merge branch 'vn/restore-empty-ita-corner-case-fix'
"git checkout" and "git restore" to re-populate the index from a tree-ish (typically HEAD) did not work correctly for a path that was removed and then added again with the intent-to-add bit, when the corresponding working tree file was empty. This has been corrected. * vn/restore-empty-ita-corner-case-fix: restore: add test for deleted ita files checkout.c: unstage empty deleted ita files
This commit is contained in:
@ -126,6 +126,7 @@ static int update_some(const struct object_id *oid, struct strbuf *base,
|
||||
if (pos >= 0) {
|
||||
struct cache_entry *old = active_cache[pos];
|
||||
if (ce->ce_mode == old->ce_mode &&
|
||||
!ce_intent_to_add(old) &&
|
||||
oideq(&ce->oid, &old->oid)) {
|
||||
old->ce_flags |= CE_UPDATE;
|
||||
discard_cache_entry(ce);
|
||||
|
Reference in New Issue
Block a user