summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 1a0da71a43..b528290902 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1483,6 +1483,8 @@ static void print_summary(const char *prefix, const struct object_id *oid,
diff_setup_done(&rev.diffopt);
head = resolve_ref_unsafe("HEAD", 0, junk_oid.hash, NULL);
+ if (!head)
+ die_errno(_("unable to resolve HEAD after creating commit"));
if (!strcmp(head, "HEAD"))
head = _("detached HEAD");
else