diff options
Diffstat (limited to 'git.c')
-rw-r--r-- | git.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -444,7 +444,7 @@ static struct cmd_struct commands[] = { { "pack-objects", cmd_pack_objects, RUN_SETUP }, { "pack-redundant", cmd_pack_redundant, RUN_SETUP }, { "pack-refs", cmd_pack_refs, RUN_SETUP }, - { "patch-id", cmd_patch_id }, + { "patch-id", cmd_patch_id, RUN_SETUP_GENTLY }, { "pickaxe", cmd_blame, RUN_SETUP }, { "prune", cmd_prune, RUN_SETUP }, { "prune-packed", cmd_prune_packed, RUN_SETUP }, @@ -522,21 +522,34 @@ static void strip_extension(const char **argv) static void handle_builtin(int argc, const char **argv) { + struct argv_array args = ARGV_ARRAY_INIT; const char *cmd; struct cmd_struct *builtin; strip_extension(argv); cmd = argv[0]; - /* Turn "git cmd --help" into "git help cmd" */ + /* Turn "git cmd --help" into "git help --exclude-guides cmd" */ if (argc > 1 && !strcmp(argv[1], "--help")) { + int i; + argv[1] = argv[0]; argv[0] = cmd = "help"; + + for (i = 0; i < argc; i++) { + argv_array_push(&args, argv[i]); + if (!i) + argv_array_push(&args, "--exclude-guides"); + } + + argc++; + argv = args.argv; } builtin = get_builtin(cmd); if (builtin) exit(run_builtin(builtin, argc, argv)); + argv_array_clear(&args); } static void execv_dashed_external(const char **argv) |