]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sequencer.c
reftable: handle null refnames in reftable_ref_record_equal
[thirdparty/git.git] / sequencer.c
index cd2aabf1f765508b13e748dcffda8073da6b9d55..b4135a78c9133da2661384d291d9cd64523e0db1 100644 (file)
@@ -997,7 +997,9 @@ static int run_git_commit(const char *defmsg,
 
        cmd.git_cmd = 1;
 
-       if (is_rebase_i(opts) && !(!defmsg && (flags & AMEND_MSG)) &&
+       if (is_rebase_i(opts) &&
+           ((opts->committer_date_is_author_date && !opts->ignore_date) ||
+            !(!defmsg && (flags & AMEND_MSG))) &&
            read_env_script(&cmd.env_array)) {
                const char *gpg_opt = gpg_sign_opt_quoted(opts);
 
@@ -1282,6 +1284,8 @@ void print_commit_summary(struct repository *r,
        struct pretty_print_context pctx = {0};
        struct strbuf author_ident = STRBUF_INIT;
        struct strbuf committer_ident = STRBUF_INIT;
+       struct ref_store *refs;
+       int resolve_errno;
 
        commit = lookup_commit(r, oid);
        if (!commit)
@@ -1331,9 +1335,13 @@ void print_commit_summary(struct repository *r,
        rev.diffopt.break_opt = 0;
        diff_setup_done(&rev.diffopt);
 
-       head = resolve_ref_unsafe("HEAD", 0, NULL, NULL);
-       if (!head)
+       refs = get_main_ref_store(the_repository);
+       head = refs_resolve_ref_unsafe(refs, "HEAD", 0, NULL, NULL,
+                                      &resolve_errno);
+       if (!head) {
+               errno = resolve_errno;
                die_errno(_("unable to resolve HEAD after creating commit"));
+       }
        if (!strcmp(head, "HEAD"))
                head = _("detached HEAD");
        else