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:
authorJacob Keller <jacob.keller@gmail.com>2015-12-30 01:40:28 +0300
committerJunio C Hamano <gitster@pobox.com>2016-01-18 00:59:01 +0300
commitb3715b75226668e26f1f2abe7e2f93cdbbf6e2f5 (patch)
treeb0d30e72a4bf580210ea8fbe3531b395eb233e3b /notes.h
parent28274d02c489f4c7e68153056e9061a46f62d7a0 (diff)
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 'notes.h')
-rw-r--r--notes.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/notes.h b/notes.h
index 2a3f923380..431f143788 100644
--- a/notes.h
+++ b/notes.h
@@ -294,4 +294,11 @@ void string_list_add_refs_from_colon_sep(struct string_list *list,
/* Expand inplace a note ref like "foo" or "notes/foo" into "refs/notes/foo" */
void expand_notes_ref(struct strbuf *sb);
+/*
+ * Similar to expand_notes_ref, but will check whether the ref can be located
+ * via get_sha1 first, and only falls back to expand_notes_ref in the case
+ * where get_sha1 fails.
+ */
+void expand_loose_notes_ref(struct strbuf *sb);
+
#endif