Skip to content

Commit

Permalink
revision.c: refactor notes ref expansion
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Mar 29, 2011
1 parent 03bb578 commit c063f0a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down

0 comments on commit c063f0a

Please sign in to comment.