Fix broken sha1 locking
[gitweb.git] / wt-status.c
index c644331b127e9f4321d916f474ac796b8ab2a9bf..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;
@@ -78,7 +76,7 @@ static void wt_status_print_filepair(int t, struct diff_filepair *p)
                                p->one->path, p->two->path);
                break;
        case DIFF_STATUS_DELETED:
-               color_printf_ln(c, "deleted: %s", p->one->path); break;
+               color_printf(c, "deleted: %s", p->one->path); break;
        case DIFF_STATUS_MODIFIED:
                color_printf(c, "modified: %s", p->one->path); break;
        case DIFF_STATUS_RENAMED: