From: Jeff King Date: Mon, 18 Sep 2006 02:13:56 +0000 (-0700) Subject: wt-status: use simplified resolve_ref to find current branch X-Git-Tag: v1.4.4-rc1~43^2~34 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f62363fb02865967e5efd17de1a09de6e02f3e3f;p=git.git wt-status: use simplified resolve_ref to find current branch Signed-off-by: Junio C Hamano --- diff --git a/wt-status.c b/wt-status.c index 4b74e6858..050922df5 100644 --- a/wt-status.c +++ b/wt-status.c @@ -41,10 +41,8 @@ void wt_status_prepare(struct wt_status *s) s->is_initial = get_sha1("HEAD", sha1) ? 1 : 0; - head = resolve_ref(git_path("HEAD"), sha1, 0); - s->branch = head ? - strdup(head + strlen(get_git_dir()) + 1) : - NULL; + head = resolve_ref("HEAD", sha1, 0); + s->branch = head ? xstrdup(head) : NULL; s->reference = "HEAD"; s->amend = 0;