Code

wt-status: use simplified resolve_ref to find current branch
authorJeff King <peff@peff.net>
Mon, 18 Sep 2006 02:13:56 +0000 (19:13 -0700)
committerJunio C Hamano <junkio@cox.net>
Mon, 18 Sep 2006 02:13:56 +0000 (19:13 -0700)
Signed-off-by: Junio C Hamano <junkio@cox.net>
wt-status.c

index 4b74e6858400108fe4967cfd371d20915d806379..050922df54de483cf7112aeb397fc555e4eb2310 100644 (file)
@@ -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;