summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2011-12-13 14:17:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-12-13 17:26:52 (GMT)
commit96ec7b1e708863d0cd6b8e72a986d6f0a1bb64db (patch)
tree6957ce802074c55c0973c8533dbd399a314ecc55 /wt-status.c
parente4776bd936aa162b7f00cb26260dc4a6ca444abb (diff)
downloadgit-96ec7b1e708863d0cd6b8e72a986d6f0a1bb64db.zip
git-96ec7b1e708863d0cd6b8e72a986d6f0a1bb64db.tar.gz
git-96ec7b1e708863d0cd6b8e72a986d6f0a1bb64db.tar.bz2
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>
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/wt-status.c b/wt-status.c
index 70fdb76..9ffc535 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -111,7 +111,6 @@ void status_printf_more(struct wt_status *s, const char *color,
void wt_status_prepare(struct wt_status *s)
{
unsigned char sha1[20];
- const char *head;
memset(s, 0, sizeof(*s));
memcpy(s->color_palette, default_wt_status_colors,
@@ -119,8 +118,7 @@ void wt_status_prepare(struct wt_status *s)
s->show_untracked_files = SHOW_NORMAL_UNTRACKED_FILES;
s->use_color = -1;
s->relative_paths = 1;
- head = resolve_ref("HEAD", sha1, 0, NULL);
- s->branch = head ? xstrdup(head) : NULL;
+ s->branch = resolve_refdup("HEAD", sha1, 0, NULL);
s->reference = "HEAD";
s->fp = stdout;
s->index_file = get_index_file();