summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-08-17 20:09:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-17 20:09:57 (GMT)
commit8ba8642bd5d89629973268ff28bc5b0b3d45e35b (patch)
tree19a0cf51bfa72424d0c9d746851092115747ada0 /read-cache.c
parentc5d276cb184cc42fb90b60b14996253b855a3e06 (diff)
parentad3762042a8d0029ff16bcbfbb2656c36cf3d662 (diff)
downloadgit-8ba8642bd5d89629973268ff28bc5b0b3d45e35b.zip
git-8ba8642bd5d89629973268ff28bc5b0b3d45e35b.tar.gz
git-8ba8642bd5d89629973268ff28bc5b0b3d45e35b.tar.bz2
Merge branch 'en/abort-df-conflict-fixes'
"git merge --abort" etc. did not clean things up properly when there were conflicted entries in the index in certain order that are involved in D/F conflicts. This has been corrected. * en/abort-df-conflict-fixes: read-cache: fix directory/file conflict handling in read_index_unmerged() t1015: demonstrate directory/file conflict recovery failures
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/read-cache.c b/read-cache.c
index 880849f..c5fabc8 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2808,10 +2808,13 @@ out:
/*
* Read the index file that is potentially unmerged into given
- * index_state, dropping any unmerged entries. Returns true if
- * the index is unmerged. Callers who want to refuse to work
- * from an unmerged state can call this and check its return value,
- * instead of calling read_cache().
+ * index_state, dropping any unmerged entries to stage #0 (potentially
+ * resulting in a path appearing as both a file and a directory in the
+ * index; the caller is responsible to clear out the extra entries
+ * before writing the index to a tree). Returns true if the index is
+ * unmerged. Callers who want to refuse to work from an unmerged
+ * state can call this and check its return value, instead of calling
+ * read_cache().
*/
int read_index_unmerged(struct index_state *istate)
{
@@ -2833,7 +2836,7 @@ int read_index_unmerged(struct index_state *istate)
new_ce->ce_flags = create_ce_flags(0) | CE_CONFLICTED;
new_ce->ce_namelen = len;
new_ce->ce_mode = ce->ce_mode;
- if (add_index_entry(istate, new_ce, 0))
+ if (add_index_entry(istate, new_ce, ADD_CACHE_SKIP_DFCHECK))
return error("%s: cannot drop to stage #0",
new_ce->name);
}