summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-08-22 19:34:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-22 19:34:11 (GMT)
commit072735ea58407db41c0874fd2f8a91d0c191d49b (patch)
tree1179894f8b5414c88bf7874a4510a702b36e8b2d /builtin
parent207ad3cb203b7adeeb52b5372ace497e20739d49 (diff)
parent620c09e1b686e06c4ddbd5fb153f7ad898bab412 (diff)
downloadgit-072735ea58407db41c0874fd2f8a91d0c191d49b.zip
git-072735ea58407db41c0874fd2f8a91d0c191d49b.tar.gz
git-072735ea58407db41c0874fd2f8a91d0c191d49b.tar.bz2
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
Diffstat (limited to 'builtin')
-rw-r--r--builtin/checkout.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 6123f73..8d3ad7c 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -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);