1
0
mirror of https://github.com/git/git.git synced 2024-09-24 04:20:53 +02:00

revision.c: refactor notes ref expansion

No need to do it ourselves when there is a library function.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King 2011-03-29 16:56:04 -04:00 committed by Junio C Hamano
parent 03bb5789cd
commit c063f0a973

View File

@ -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")) {