summaryrefslogtreecommitdiff
path: root/builtin/diff-tree.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-06-19 12:38:45 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-06-19 12:38:45 -0700
commit50ad8561dee9d479e41586689486cbbb4a742f7b (patch)
tree41687648bc7b1674a109fdeb490b9b749f458fde /builtin/diff-tree.c
parentMerge branch 'ab/perf-remove-index-lock' (diff)
parentt0012: test "-h" with builtins (diff)
downloadtgif-50ad8561dee9d479e41586689486cbbb4a742f7b.tar.xz
Merge branch 'jk/consistent-h'
"git $cmd -h" for builtin commands calls the implementation of the command (i.e. cmd_$cmd() function) without doing any repository set-up, and the commands that expect RUN_SETUP is done by the Git potty needs to be prepared to show the help text without barfing. * jk/consistent-h: t0012: test "-h" with builtins git: add hidden --list-builtins option version: convert to parse-options diff- and log- family: handle "git cmd -h" early submodule--helper: show usage for "-h" remote-{ext,fd}: print usage message on invalid arguments upload-archive: handle "-h" option early credential: handle invalid arguments earlier
Diffstat (limited to 'builtin/diff-tree.c')
-rw-r--r--builtin/diff-tree.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index 1fd06eac4b..7e15d01f36 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -104,6 +104,9 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
struct setup_revision_opt s_r_opt;
int read_stdin = 0;
+ if (argc == 2 && !strcmp(argv[1], "-h"))
+ usage(diff_tree_usage);
+
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
init_revisions(opt, prefix);
gitmodules_config();