From b3715b75226668e26f1f2abe7e2f93cdbbf6e2f5 Mon Sep 17 00:00:00 2001 From: Jacob Keller Date: Tue, 29 Dec 2015 14:40:28 -0800 Subject: notes: allow merging from arbitrary references Create a new expansion function, expand_loose_notes_ref which will first check whether the ref can be found using get_sha1. If it can't be found then it will fallback to using expand_notes_ref. The content of the strbuf will not be changed if the notes ref can be located using get_sha1. Otherwise, it may be updated as done by expand_notes_ref. Since we now support merging from non-notes refs, remove the test case associated with that behavior. Add a test case for merging from a non-notes ref. Signed-off-by: Jacob Keller Reviewed-by: Johan Herland Signed-off-by: Junio C Hamano --- builtin/notes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin/notes.c') diff --git a/builtin/notes.c b/builtin/notes.c index 52aa9af74b..b16b8b56a0 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -806,7 +806,7 @@ static int merge(int argc, const char **argv, const char *prefix) o.local_ref = default_notes_ref(); strbuf_addstr(&remote_ref, argv[0]); - expand_notes_ref(&remote_ref); + expand_loose_notes_ref(&remote_ref); o.remote_ref = remote_ref.buf; t = init_notes_check("merge"); -- cgit v1.2.1