aboutsummaryrefslogtreecommitdiff
path: root/builtin/notes.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/notes.c')
-rw-r--r--builtin/notes.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/builtin/notes.c b/builtin/notes.c
index 9026d567c..ebd3e62e8 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -816,7 +816,19 @@ static int merge(int argc, const char **argv, const char *prefix)
usage_with_options(git_notes_merge_usage, options);
}
} else {
- git_config_get_notes_strategy("notes.mergeStrategy", &o.strategy);
+ struct strbuf merge_key = STRBUF_INIT;
+ const char *short_ref = NULL;
+
+ if (!skip_prefix(o.local_ref, "refs/notes/", &short_ref))
+ die("BUG: local ref %s is outside of refs/notes/",
+ o.local_ref);
+
+ strbuf_addf(&merge_key, "notes.%s.mergeStrategy", short_ref);
+
+ if (git_config_get_notes_strategy(merge_key.buf, &o.strategy))
+ git_config_get_notes_strategy("notes.mergeStrategy", &o.strategy);
+
+ strbuf_release(&merge_key);
}
strbuf_addf(&msg, "notes: Merged notes from %s into %s",