summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-11-06 13:11:25 +0900
committerJunio C Hamano <gitster@pobox.com>2017-11-06 13:11:25 +0900
commit4a1638cbd5ab1037cbf5cde652de0b041e952d55 (patch)
treedcfd53f258cc8d71fdbe5b0e9da25483abbc0f9e /builtin/commit.c
parenta823e3a7fc75c25677d7d6eaa9defc089412ff0e (diff)
parentc26de08370ad5d927d93dbe6fb46103caabb889c (diff)
downloadgit-4a1638cbd5ab1037cbf5cde652de0b041e952d55.tar.gz
Merge branch 'ao/check-resolve-ref-unsafe-result'
"git commit", after making a commit, did not check for errors when asking on what branch it made the commit, which has been correted. * ao/check-resolve-ref-unsafe-result: commit: check result of resolve_ref_unsafe
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 af034553fc..1a4ad725bc 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1492,6 +1492,8 @@ static void print_summary(const char *prefix, const struct object_id *oid,
diff_setup_done(&rev.diffopt);
head = resolve_ref_unsafe("HEAD", 0, NULL, NULL);
+ if (!head)
+ die_errno(_("unable to resolve HEAD after creating commit"));
if (!strcmp(head, "HEAD"))
head = _("detached HEAD");
else