diff options
author | Jeff King <peff@peff.net> | 2011-03-29 16:55:32 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-03-29 14:29:17 -0700 |
commit | 03bb5789cd97de989897e1c9de71a2831ada0544 (patch) | |
tree | f4aba44ff79618a5869cee6683ddd3488cc596c3 /notes.c | |
parent | 07514c83c2b7e6de926ef758905e3f43b4de6bfa (diff) | |
download | git-03bb5789cd97de989897e1c9de71a2831ada0544.tar.gz |
notes: make expand_notes_ref globally accessible
This function is useful for other commands besides "git
notes" which want to let users refer to notes by their
shorthand name.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'notes.c')
-rw-r--r-- | notes.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -1285,3 +1285,13 @@ int copy_note(struct notes_tree *t, return 0; } + +void expand_notes_ref(struct strbuf *sb) +{ + if (!prefixcmp(sb->buf, "refs/notes/")) + return; /* we're happy */ + else if (!prefixcmp(sb->buf, "notes/")) + strbuf_insert(sb, 0, "refs/", 5); + else + strbuf_insert(sb, 0, "refs/notes/", 11); +} |