summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-11-15 12:04:53 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-11-15 12:04:53 +0900
commita9749b0b785c2ccf245835d9a8426fa28c62005e (patch)
tree1dfa16f597fb802831ae12f4651424307fb8d77a /builtin
parentMerge branch 'jk/misc-resolve-ref-unsafe-fixes' into maint (diff)
parentcommit: check result of resolve_ref_unsafe (diff)
downloadtgif-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 d75b3805ea..b2a6c7f100 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