X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=wt-status.c;h=9ffc535f1ab0296fd0a3330b1f136d69f9ac9bb2;hb=a12c6b0149e3dadd0701dac4fd0ba2463d251650;hp=70fdb76ff2b5100c6d20f9f3b758e1ac8df314e1;hpb=9a8e485430492a1377885071c94983c2da547174;p=git.git diff --git a/wt-status.c b/wt-status.c index 70fdb76ff..9ffc535f1 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();