diff --git a/wt-status.c b/wt-status.c
index 4b74e6858400108fe4967cfd371d20915d806379..050922df54de483cf7112aeb397fc555e4eb2310 100644 (file)
--- a/wt-status.c
+++ b/wt-status.c
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;