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 v1 (full range-diff below): - Make use of test_write_lines, as suggested by Eric. - Provide a little more explanation in one of the commit messages, as suggested by Junio. 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 | 1 - 4 files changed, 131 insertions(+), 9 deletions(-) create mode 100755 t/t1015-read-index-unmerged.sh 1: a85e462914 ! 1: 8f53327a8d t1015: demonstrate directory/file conflict recovery failures @@ -29,7 +29,7 @@ + ( + cd df_plus_modify_delete && + -+ printf "a\nb\nc\nd\ne\nf\ng\nh\n" >letters && ++ test_write_lines a b c d e f g h >letters && + git add letters && + git commit -m initial && + 2: 43d5b0a5ae ! 2: 990a469d44 read-cache: fix directory/file conflict handling in read_index_unmerged() @@ -53,7 +53,9 @@ we can just skip the DFCHECK and allow both the file and directory to appear in the index. The temporary simultaneous appearance of the directory and file entries in the index will be removed by the callers - before they attempt to write the index anywhere. + by calling unpack_trees(), which excludes these unmerged entries marked + with CE_CONFLICTED flag from the resulting index, before they attempt to + write the index anywhere. Signed-off-by: Elijah Newren <newren@xxxxxxxxx> -- 2.18.0.645.g72fe132ec2