X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-commit-tree.c;h=ddcb7a4bbbcd45dfd7437209f3187fff882e6e62;hb=1cef6500a9edc7997bd0aa4cd1f739f5106ab0a9;hp=0453425c471f1d6793bc7f5f59d17e9d285ddfc6;hpb=2beba6beb0074afac988594539572865fb37a00f;p=git.git diff --git a/builtin-commit-tree.c b/builtin-commit-tree.c index 0453425c4..ddcb7a4bb 100644 --- a/builtin-commit-tree.c +++ b/builtin-commit-tree.c @@ -105,7 +105,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 +124,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));