@matheusbsbs / matheus-bagliano / commits / c063f0a973
Fork 0

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>

Jeff King committed Mar 29, 2011 at 16:56 UTC c063f0a973832784f09a6901eac9501b6f796bde
1 file changed +1 -6
revision.c
+1 -6
@@ -1374,13 +1374,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
1374 revs->show_notes_given = 1;
1375 if (!revs->notes_opt.extra_notes_refs)
1376 revs->notes_opt.extra_notes_refs = xcalloc(1, sizeof(struct string_list));
1377 - if (!prefixcmp(arg+13, "refs/"))
1378 - /* happy */;
1379 - else if (!prefixcmp(arg+13, "notes/"))
1380 - strbuf_addstr(&buf, "refs/");
1381 - else
1382 - strbuf_addstr(&buf, "refs/notes/");
1377 strbuf_addstr(&buf, arg+13);
1378 + expand_notes_ref(&buf);
1379 string_list_append(revs->notes_opt.extra_notes_refs,
1380 strbuf_detach(&buf, NULL));
1381 } else if (!strcmp(arg, "--no-notes")) {