aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-11-15 12:04:53 +0900
committerJunio C Hamano <gitster@pobox.com>2017-11-15 12:04:53 +0900
commita9749b0b785c2ccf245835d9a8426fa28c62005e (patch)
tree1dfa16f597fb802831ae12f4651424307fb8d77a /builtin
parent9fbcb51ec548318f0088a5fee6c77a5f1d8512b4 (diff)
parentc26de08370ad5d927d93dbe6fb46103caabb889c (diff)
downloadgit-a9749b0b785c2ccf245835d9a8426fa28c62005e.tar.gz
git-a9749b0b785c2ccf245835d9a8426fa28c62005e.tar.xz
Merge branch 'ao/check-resolve-ref-unsafe-result' into maint
"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')
-rw-r--r--builtin/commit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index d75b3805e..b2a6c7f10 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