Unverified Commit 61f1e31a by Edward Thomson Committed by GitHub

Merge pull request #6197 from libgit2/ethomson/merge_msg_conflict_comment

merge: comment conflicts lines in MERGE_MSG
parents 18a477e7 c0297d47
...@@ -3126,7 +3126,7 @@ int git_merge__append_conflicts_to_merge_msg( ...@@ -3126,7 +3126,7 @@ int git_merge__append_conflicts_to_merge_msg(
(error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_APPEND, GIT_MERGE_FILE_MODE)) < 0) (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_APPEND, GIT_MERGE_FILE_MODE)) < 0)
goto cleanup; goto cleanup;
git_filebuf_printf(&file, "\nConflicts:\n"); git_filebuf_printf(&file, "\n#Conflicts:\n");
for (i = 0; i < git_index_entrycount(index); i++) { for (i = 0; i < git_index_entrycount(index); i++) {
const git_index_entry *e = git_index_get_byindex(index, i); const git_index_entry *e = git_index_get_byindex(index, i);
...@@ -3135,7 +3135,7 @@ int git_merge__append_conflicts_to_merge_msg( ...@@ -3135,7 +3135,7 @@ int git_merge__append_conflicts_to_merge_msg(
continue; continue;
if (last == NULL || strcmp(e->path, last) != 0) if (last == NULL || strcmp(e->path, last) != 0)
git_filebuf_printf(&file, "\t%s\n", e->path); git_filebuf_printf(&file, "#\t%s\n", e->path);
last = e->path; last = e->path;
} }
......
...@@ -170,9 +170,9 @@ void test_cherrypick_workdir__conflicts(void) ...@@ -170,9 +170,9 @@ void test_cherrypick_workdir__conflicts(void)
cl_assert(strcmp(git_str_cstr(&mergemsg_buf), cl_assert(strcmp(git_str_cstr(&mergemsg_buf),
"Change all files\n" \ "Change all files\n" \
"\n" \ "\n" \
"Conflicts:\n" \ "#Conflicts:\n" \
"\tfile2.txt\n" \ "#\tfile2.txt\n" \
"\tfile3.txt\n") == 0); "#\tfile3.txt\n") == 0);
cl_git_pass(git_futils_readbuffer(&conflicting_buf, cl_git_pass(git_futils_readbuffer(&conflicting_buf,
TEST_REPO_PATH "/file2.txt")); TEST_REPO_PATH "/file2.txt"));
...@@ -352,10 +352,10 @@ void test_cherrypick_workdir__both_renamed(void) ...@@ -352,10 +352,10 @@ void test_cherrypick_workdir__both_renamed(void)
cl_assert(strcmp(git_str_cstr(&mergemsg_buf), cl_assert(strcmp(git_str_cstr(&mergemsg_buf),
"Renamed file3.txt -> file3.txt.renamed\n" \ "Renamed file3.txt -> file3.txt.renamed\n" \
"\n" \ "\n" \
"Conflicts:\n" \ "#Conflicts:\n" \
"\tfile3.txt\n" \ "#\tfile3.txt\n" \
"\tfile3.txt.renamed\n" \ "#\tfile3.txt.renamed\n" \
"\tfile3.txt.renamed_on_branch\n") == 0); "#\tfile3.txt.renamed_on_branch\n") == 0);
git_str_dispose(&mergemsg_buf); git_str_dispose(&mergemsg_buf);
git_commit_free(commit); git_commit_free(commit);
......
...@@ -278,8 +278,8 @@ void test_merge_workdir_simple__mergefile(void) ...@@ -278,8 +278,8 @@ void test_merge_workdir_simple__mergefile(void)
cl_assert(strcmp(git_str_cstr(&mergemsg_buf), cl_assert(strcmp(git_str_cstr(&mergemsg_buf),
"Merge commit '7cb63eed597130ba4abb87b3e544b85021905520'\n" \ "Merge commit '7cb63eed597130ba4abb87b3e544b85021905520'\n" \
"\n" \ "\n" \
"Conflicts:\n" \ "#Conflicts:\n" \
"\tconflicting.txt\n") == 0); "#\tconflicting.txt\n") == 0);
git_str_dispose(&conflicting_buf); git_str_dispose(&conflicting_buf);
git_str_dispose(&mergemsg_buf); git_str_dispose(&mergemsg_buf);
......
...@@ -119,8 +119,8 @@ void test_revert_workdir__conflicts(void) ...@@ -119,8 +119,8 @@ void test_revert_workdir__conflicts(void)
"\n" \ "\n" \
"This reverts commit 72333f47d4e83616630ff3b0ffe4c0faebcc3c45.\n" "This reverts commit 72333f47d4e83616630ff3b0ffe4c0faebcc3c45.\n"
"\n" \ "\n" \
"Conflicts:\n" \ "#Conflicts:\n" \
"\tfile1.txt\n") == 0); "#\tfile1.txt\n") == 0);
git_commit_free(commit); git_commit_free(commit);
git_commit_free(head); git_commit_free(head);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment