Sync with Git 2.14.4
[gitweb.git] / builtin / commit.c
index d75b3805ea7fe3475564f337bf660d8155909445..be370f64a995804ec6b62e03f7c6940044e08e24 100644 (file)
@@ -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
@@ -1728,7 +1730,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
                                allow_fast_forward = 0;
                }
                if (allow_fast_forward)
-                       parents = reduce_heads(parents);
+                       reduce_heads_replace(&parents);
        } else {
                if (!reflog_msg)
                        reflog_msg = (whence == FROM_CHERRY_PICK)