Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
commit: check result of resolve_ref_unsafe
[gitweb.git]
/
builtin
/
commit.c
diff --git
a/builtin/commit.c
b/builtin/commit.c
index 1a0da71a43cfef8818b52a3d27131e340725cef2..b528290902da1153849e6cf4560488c553a1e38a 100644
(file)
--- 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