summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2006-09-17 19:13:56 -0700
committerJunio C Hamano <junkio@cox.net>2006-09-17 19:13:56 -0700
commitf62363fb02865967e5efd17de1a09de6e02f3e3f (patch)
treef8f9c9ab9a8039498d5368e3f88b4e055381316c /wt-status.c
parentef176ad06afde424b2167da290a0fdd7fb8ca3d4 (diff)
downloadgit-f62363fb02865967e5efd17de1a09de6e02f3e3f.tar.gz
wt-status: use simplified resolve_ref to find current branch
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/wt-status.c b/wt-status.c
index 4b74e68584..050922df54 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;