wt-status: use simplified resolve_ref to find current branch
Signed-off-by: Junio C Hamano <junkio@cox.net>
Jeff King committed
Sep 17, 2006 at 19:13 UTC
f62363fb02865967e5efd17de1a09de6e02f3e3f
1 file changed
+2
-4
wt-status.c
+2
-4
@@ -41,10 +41,8 @@ void wt_status_prepare(struct wt_status *s)
41
42
s->is_initial = get_sha1("HEAD", sha1) ? 1 : 0;
43
44
- head = resolve_ref(git_path("HEAD"), sha1, 0);
45
- s->branch = head ?
46
- strdup(head + strlen(get_git_dir()) + 1) :
47
- NULL;
44
+ head = resolve_ref("HEAD", sha1, 0);
45
+ s->branch = head ? xstrdup(head) : NULL;
46
47
s->reference = "HEAD";
48
s->amend = 0;