Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-08-22 22:34:11 +0300
committerJunio C Hamano <gitster@pobox.com>2019-08-22 22:34:11 +0300
commit072735ea58407db41c0874fd2f8a91d0c191d49b (patch)
tree1179894f8b5414c88bf7874a4510a702b36e8b2d /builtin/checkout.c
parent207ad3cb203b7adeeb52b5372ace497e20739d49 (diff)
parent620c09e1b686e06c4ddbd5fb153f7ad898bab412 (diff)
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/checkout.c')
-rw-r--r--builtin/checkout.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 6123f732a2c..8d3ad7cd9e7 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);