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
This commit is contained in:
Junio C Hamano
2016-02-03 14:15:59 -08:00
4 changed files with 29 additions and 12 deletions

10
notes.c
View File

@ -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);
}
}