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;
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: