summaryrefslogtreecommitdiff
path: root/notes.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-03 14:15:59 -0800
committerJunio C Hamano <gitster@pobox.com>2016-02-03 14:15:59 -0800
commit1cb3ed308dcfaa6084b8aed075c772aeb9e57243 (patch)
tree75a9536e7071b4785887ef6c251be09df45d46d9 /notes.c
parent017565525f969c26c43443d998a1283cac843d10 (diff)
parentb3715b75226668e26f1f2abe7e2f93cdbbf6e2f5 (diff)
downloadgit-1cb3ed308dcfaa6084b8aed075c772aeb9e57243.tar.gz
Merge branch 'jk/notes-merge-from-anywhere'
"git notes merge" used to limit the source of the merged notes tree to somewhere under refs/notes/ hierarchy, which was too limiting when inventing a workflow to exchange notes with remote repositories using remote-tracking notes trees (located in e.g. refs/remote-notes/ or somesuch). * jk/notes-merge-from-anywhere: notes: allow merging from arbitrary references
Diffstat (limited to 'notes.c')
-rw-r--r--notes.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/notes.c b/notes.c
index 358e2fdb74..c1e5035590 100644
--- a/notes.c
+++ b/notes.c
@@ -1306,3 +1306,13 @@ void expand_notes_ref(struct strbuf *sb)
else
strbuf_insert(sb, 0, "refs/notes/", 11);
}
+
+void expand_loose_notes_ref(struct strbuf *sb)
+{
+ unsigned char object[20];
+
+ if (get_sha1(sb->buf, object)) {
+ /* fallback to expand_notes_ref */
+ expand_notes_ref(sb);
+ }
+}