Convert resolve_ref+xstrdup to new resolve_refdup function

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nguyễn Thái Ngọc Duy
2011-12-13 21:17:48 +07:00
committed by Junio C Hamano
parent e4776bd936
commit 96ec7b1e70
12 changed files with 47 additions and 50 deletions

View File

@ -726,10 +726,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
if (ac == 0) {
static const char *fake_av[2];
const char *refname;
refname = resolve_ref("HEAD", sha1, 1, NULL);
fake_av[0] = xstrdup(refname);
fake_av[0] = resolve_refdup("HEAD", sha1, 1, NULL);
fake_av[1] = NULL;
av = fake_av;
ac = 1;