Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/notes.c')
-rw-r--r--builtin/notes.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/builtin/notes.c b/builtin/notes.c
index 32d8a24944..c7761b1140 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -765,6 +765,7 @@ static int merge(int argc, const char **argv, const char *prefix)
{
struct strbuf remote_ref = STRBUF_INIT, msg = STRBUF_INIT;
unsigned char result_sha1[20];
+ struct notes_tree *t;
struct notes_merge_options o;
int verbosity = 0, result;
struct option options[] = {
@@ -788,19 +789,23 @@ static int merge(int argc, const char **argv, const char *prefix)
expand_notes_ref(&remote_ref);
o.remote_ref = remote_ref.buf;
- result = notes_merge(&o, result_sha1);
+ t = init_notes_check("merge");
strbuf_addf(&msg, "notes: Merged notes from %s into %s",
remote_ref.buf, default_notes_ref());
- if (result == 0) { /* Merge resulted (trivially) in result_sha1 */
+ o.commit_msg = msg.buf + 7; // skip "notes: " prefix
+
+ result = notes_merge(&o, t, result_sha1);
+
+ if (result >= 0) /* Merge resulted (trivially) in result_sha1 */
/* Update default notes ref with new commit */
update_ref(msg.buf, default_notes_ref(), result_sha1, NULL,
0, DIE_ON_ERR);
- } else {
+ else
/* TODO: */
- die("'git notes merge' cannot yet handle non-trivial merges!");
- }
+ die("'git notes merge' cannot yet handle conflicts!");
+ free_notes(t);
strbuf_release(&remote_ref);
strbuf_release(&msg);
return 0;