]> git.ipfire.org Git - thirdparty/git.git/blobdiff - commit.c
refs: print error message in debug output
[thirdparty/git.git] / commit.c
index 143f472c0f24bfeece3209a4c8bf70be9494b557..a348f085b2b853d2f14d6848f3ff57edf85601b8 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -25,6 +25,7 @@
 static struct commit_extra_header *read_commit_extra_header_lines(const char *buf, size_t len, const char **);
 
 int save_commit_buffer = 1;
+int no_graft_file_deprecated_advice;
 
 const char *commit_type = "commit";
 
@@ -190,7 +191,8 @@ static int read_graft_file(struct repository *r, const char *graft_file)
        struct strbuf buf = STRBUF_INIT;
        if (!fp)
                return -1;
-       if (advice_graft_file_deprecated)
+       if (!no_graft_file_deprecated_advice &&
+           advice_enabled(ADVICE_GRAFT_FILE_DEPRECATED))
                advise(_("Support for <GIT_DIR>/info/grafts is deprecated\n"
                         "and will be removed in a future Git version.\n"
                         "\n"
@@ -1210,8 +1212,10 @@ int check_commit_signature(const struct commit *commit, struct signature_check *
 
        if (parse_signed_commit(commit, &payload, &signature, the_hash_algo) <= 0)
                goto out;
-       ret = check_signature(payload.buf, payload.len, signature.buf,
-               signature.len, sigc);
+
+       sigc->payload_type = SIGNATURE_PAYLOAD_COMMIT;
+       sigc->payload = strbuf_detach(&payload, &sigc->payload_len);
+       ret = check_signature(sigc, signature.buf, signature.len);
 
  out:
        strbuf_release(&payload);