X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=sequencer.c;h=b4135a78c9133da2661384d291d9cd64523e0db1;hb=e39ceeb475ea019e91a3cccacce7ccd807c55bca;hp=ea96837cde3bad6faa9cf016323fe3267a538cb4;hpb=c152456453906eb3feabaeb7197475263fcc03ce;p=thirdparty%2Fgit.git diff --git a/sequencer.c b/sequencer.c index ea96837cde..b4135a78c9 100644 --- a/sequencer.c +++ b/sequencer.c @@ -1284,6 +1284,8 @@ void print_commit_summary(struct repository *r, struct pretty_print_context pctx = {0}; struct strbuf author_ident = STRBUF_INIT; struct strbuf committer_ident = STRBUF_INIT; + struct ref_store *refs; + int resolve_errno; commit = lookup_commit(r, oid); if (!commit) @@ -1333,9 +1335,13 @@ void print_commit_summary(struct repository *r, rev.diffopt.break_opt = 0; diff_setup_done(&rev.diffopt); - head = resolve_ref_unsafe("HEAD", 0, NULL, NULL); - if (!head) + refs = get_main_ref_store(the_repository); + head = refs_resolve_ref_unsafe(refs, "HEAD", 0, NULL, NULL, + &resolve_errno); + if (!head) { + errno = resolve_errno; die_errno(_("unable to resolve HEAD after creating commit")); + } if (!strcmp(head, "HEAD")) head = _("detached HEAD"); else