This patch series fixes several "recovery" commands that outright fail or do not fully recover when directory-file conflicts are present. This includes: * git read-tree --reset HEAD * git am --skip * git am --abort * git merge --abort (or git reset --merge) * git reset --hard Changes since v2 (full range-diff below): - Backported to maint (there were some textual conflicts in t6042 due to the merging of en/merge-recursive-tests to master), because of this comment from Junio's what's cooking email: "This may have to be rebased on an older maintenance track before moving forward." Elijah Newren (2): t1015: demonstrate directory/file conflict recovery failures read-cache: fix directory/file conflict handling in read_index_unmerged() read-cache.c | 13 +-- t/t1015-read-index-unmerged.sh | 123 +++++++++++++++++++++++++++ t/t6020-merge-df.sh | 3 - t/t6042-merge-rename-corner-cases.sh | 2 - 4 files changed, 131 insertions(+), 10 deletions(-) create mode 100755 t/t1015-read-index-unmerged.sh 1: 4a1c9c3368 ! 1: 00f94a8b41 t1015: demonstrate directory/file conflict recovery failures @@ -14,7 +14,6 @@ Signed-off-by: Elijah Newren <newren@xxxxxxxxx> Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx> - Message-Id: <20180713163331.22446-2-newren@xxxxxxxxx> diff --git a/t/t1015-read-index-unmerged.sh b/t/t1015-read-index-unmerged.sh new file mode 100755 2: e105e8bfbd ! 2: d3b8d7edb6 read-cache: fix directory/file conflict handling in read_index_unmerged() @@ -59,7 +59,6 @@ Signed-off-by: Elijah Newren <newren@xxxxxxxxx> Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx> - Message-Id: <20180713163331.22446-3-newren@xxxxxxxxx> diff --git a/read-cache.c b/read-cache.c --- a/read-cache.c @@ -150,10 +149,18 @@ --- a/t/t6042-merge-rename-corner-cases.sh +++ b/t/t6042-merge-rename-corner-cases.sh @@ - ( - cd rename-directory-1 && + ' + + test_expect_success 'rename/directory conflict + clean content merge' ' +- git reset --hard && + git reset --hard && + git clean -fdqx && -- git reset --hard && - git reset --hard && - git clean -fdqx && +@@ + ' + + test_expect_success 'rename/directory conflict + content merge conflict' ' +- git reset --hard && + git reset --hard && + git clean -fdqx && -- 2.18.0.2.gf4c50c7885