diff options
author | Elijah Newren <newren@gmail.com> | 2022-06-18 03:20:52 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-06-23 02:10:06 +0300 |
commit | 7fa3338870d66dd3946c5c3a0bd09dadb798893d (patch) | |
tree | 040f35db3176e5d9f94c60d2270619734af1dc26 /t/t4301-merge-tree-write-tree.sh | |
parent | a4040cfa35d8781df3e994380d1b559be8b22bd2 (diff) |
merge-tree: provide a list of which files have conflicts
Callers of `git merge-tree --write-tree` will often want to know which
files had conflicts. While they could potentially attempt to parse the
CONFLICT notices printed, those messages are not meant to be machine
readable. Provide a simpler mechanism of just printing the files (in
the same format as `git ls-files` with quoting, but restricted to
unmerged files) in the output before the free-form messages.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4301-merge-tree-write-tree.sh')
-rwxr-xr-x | t/t4301-merge-tree-write-tree.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t4301-merge-tree-write-tree.sh b/t/t4301-merge-tree-write-tree.sh index 719d81e717..8e6dba4428 100755 --- a/t/t4301-merge-tree-write-tree.sh +++ b/t/t4301-merge-tree-write-tree.sh @@ -117,6 +117,8 @@ test_expect_success 'test conflict notices and such' ' # "whatever" has *both* a modify/delete and a file/directory conflict cat <<-EOF >expect && HASH + greeting + whatever~side1 Auto-merging greeting CONFLICT (content): Merge conflict in greeting @@ -140,4 +142,13 @@ do ' done +test_expect_success 'Just the conflicted files without the messages' ' + test_expect_code 1 git merge-tree --write-tree --no-messages side1 side2 >out && + anonymize_hash out >actual && + + test_write_lines HASH greeting whatever~side1 >expect && + + test_cmp expect actual +' + test_done |