From: Jeff King Date: Tue, 29 Mar 2011 20:56:04 +0000 (-0400) Subject: revision.c: refactor notes ref expansion X-Git-Tag: v1.7.6-rc0~122^2~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c063f0a973832784f09a6901eac9501b6f796bde;p=git.git revision.c: refactor notes ref expansion No need to do it ourselves when there is a library function. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/revision.c b/revision.c index 0f38364cf..5826e5d59 100644 --- a/revision.c +++ b/revision.c @@ -1374,13 +1374,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg revs->show_notes_given = 1; if (!revs->notes_opt.extra_notes_refs) revs->notes_opt.extra_notes_refs = xcalloc(1, sizeof(struct string_list)); - if (!prefixcmp(arg+13, "refs/")) - /* happy */; - else if (!prefixcmp(arg+13, "notes/")) - strbuf_addstr(&buf, "refs/"); - else - strbuf_addstr(&buf, "refs/notes/"); strbuf_addstr(&buf, arg+13); + expand_notes_ref(&buf); string_list_append(revs->notes_opt.extra_notes_refs, strbuf_detach(&buf, NULL)); } else if (!strcmp(arg, "--no-notes")) {