summaryrefslogtreecommitdiff
path: root/builtin/notes.c
diff options
context:
space:
mode:
authorJacob Keller <jacob.keller@gmail.com>2015-12-29 22:40:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-01-17 21:59:01 (GMT)
commitb3715b75226668e26f1f2abe7e2f93cdbbf6e2f5 (patch)
treeb0d30e72a4bf580210ea8fbe3531b395eb233e3b /builtin/notes.c
parent28274d02c489f4c7e68153056e9061a46f62d7a0 (diff)
downloadgit-b3715b75226668e26f1f2abe7e2f93cdbbf6e2f5.zip
git-b3715b75226668e26f1f2abe7e2f93cdbbf6e2f5.tar.gz
git-b3715b75226668e26f1f2abe7e2f93cdbbf6e2f5.tar.bz2
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 <jacob.keller@gmail.com> Reviewed-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/notes.c')
-rw-r--r--builtin/notes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/notes.c b/builtin/notes.c
index 52aa9af..b16b8b5 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");