Code

Makefile: Remove usage of deprecated Python "has_key" method
[git.git] / builtin-commit-tree.c
index 0453425c471f1d6793bc7f5f59d17e9d285ddfc6..90dac349a3137405baaea63bfb6c798d2f8c92a3 100644 (file)
@@ -9,8 +9,6 @@
 #include "builtin.h"
 #include "utf8.h"
 
-#define BLOCKING (1ul << 14)
-
 /*
  * FIXME! Share the code with "write-tree.c"
  */
@@ -105,7 +103,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
 
        git_config(git_default_config, NULL);
 
-       if (argc < 2)
+       if (argc < 2 || !strcmp(argv[1], "-h"))
                usage(commit_tree_usage);
        if (get_sha1(argv[1], tree_sha1))
                die("Not a valid object name %s", argv[1]);
@@ -124,7 +122,7 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
        }
 
        if (strbuf_read(&buffer, 0, 0) < 0)
-               die("git commit-tree: read returned %s", strerror(errno));
+               die_errno("git commit-tree: failed to read");
 
        if (!commit_tree(buffer.buf, tree_sha1, parents, commit_sha1, NULL)) {
                printf("%s\n", sha1_to_hex(commit_sha1));