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
This commit is contained in:
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user