rev-parse: add --shared-index-path to get shared index path
[gitweb.git] / builtin / commit-tree.c
index eac901a0ee15f72eacffea32d1b327c7a336f19c..987a4c3d731d7cf01f61e4fddec208b4cb51a4af 100644 (file)
@@ -10,7 +10,9 @@
 #include "utf8.h"
 #include "gpg-interface.h"
 
-static const char commit_tree_usage[] = "git commit-tree [(-p <sha1>)...] [-S<signer>] [-m <message>] [-F <file>] <sha1> <changelog";
+static const char commit_tree_usage[] = "git commit-tree [(-p <sha1>)...] [-S[<keyid>]] [-m <message>] [-F <file>] <sha1> <changelog";
+
+static const char *sign_commit;
 
 static void new_parent(struct commit *parent, struct commit_list **parents_p)
 {
@@ -31,6 +33,10 @@ static int commit_tree_config(const char *var, const char *value, void *cb)
        int status = git_gpg_config(var, value, NULL);
        if (status)
                return status;
+       if (!strcmp(var, "commit.gpgsign")) {
+               sign_commit = git_config_bool(var, value) ? "" : NULL;
+               return 0;
+       }
        return git_default_config(var, value, cb);
 }
 
@@ -41,7 +47,6 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
        unsigned char tree_sha1[20];
        unsigned char commit_sha1[20];
        struct strbuf buffer = STRBUF_INIT;
-       const char *sign_commit = NULL;
 
        git_config(commit_tree_config, NULL);
 
@@ -66,6 +71,11 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
                        continue;
                }
 
+               if (!strcmp(arg, "--no-gpg-sign")) {
+                       sign_commit = NULL;
+                       continue;
+               }
+
                if (!strcmp(arg, "-m")) {
                        if (argc <= ++i)
                                usage(commit_tree_usage);