X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=git.c;h=4b7bd77b809b1d353b591c16aab83af5ab3a6a71;hb=HEAD;hp=7068a184b0a2947c6d62c3331c6f1a418708c7be;hpb=cf47fb7ec7e183a1a1e521a540862fba3c2a89eb;p=thirdparty%2Fgit.git diff --git a/git.c b/git.c index 7068a184b0..637c61ca9c 100644 --- a/git.c +++ b/git.c @@ -4,6 +4,7 @@ #include "exec-cmd.h" #include "gettext.h" #include "help.h" +#include "object-file.h" #include "pager.h" #include "read-cache-ll.h" #include "run-command.h" @@ -35,9 +36,10 @@ struct cmd_struct { const char git_usage_string[] = N_("git [-v | --version] [-h | --help] [-C ] [-c =]\n" " [--exec-path[=]] [--html-path] [--man-path] [--info-path]\n" - " [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n" - " [--git-dir=] [--work-tree=] [--namespace=]\n" - " [--config-env==] []"); + " [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--no-lazy-fetch]\n" + " [--no-optional-locks] [--no-advice] [--bare] [--git-dir=]\n" + " [--work-tree=] [--namespace=] [--config-env==]\n" + " []"); const char git_more_info_string[] = N_("'git help -a' and 'git help -g' list available subcommands and some\n" @@ -186,6 +188,11 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) use_pager = 0; if (envchanged) *envchanged = 1; + } else if (!strcmp(cmd, "--no-lazy-fetch")) { + fetch_if_missing = 0; + setenv(NO_LAZY_FETCH_ENVIRONMENT, "1", 1); + if (envchanged) + *envchanged = 1; } else if (!strcmp(cmd, "--no-replace-objects")) { disable_replace_refs(); setenv(NO_REPLACE_OBJECTS_ENVIRONMENT, "1", 1); @@ -331,6 +338,10 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) setenv(GIT_ATTR_SOURCE_ENVIRONMENT, cmd, 1); if (envchanged) *envchanged = 1; + } else if (!strcmp(cmd, "--no-advice")) { + setenv(GIT_ADVICE_ENVIRONMENT, "0", 1); + if (envchanged) + *envchanged = 1; } else { fprintf(stderr, _("unknown option: %s\n"), cmd); usage(git_usage_string); @@ -373,8 +384,6 @@ static int handle_alias(int *argcp, const char ***argv) strvec_pushv(&child.args, (*argv) + 1); trace2_cmd_alias(alias_command, child.args.v); - trace2_cmd_list_config(); - trace2_cmd_list_env_vars(); trace2_cmd_name("_run_shell_alias_"); ret = run_command(&child); @@ -411,8 +420,6 @@ static int handle_alias(int *argcp, const char ***argv) COPY_ARRAY(new_argv + count, *argv + 1, *argcp); trace2_cmd_alias(alias_command, new_argv); - trace2_cmd_list_config(); - trace2_cmd_list_env_vars(); *argv = new_argv; *argcp += count - 1; @@ -462,8 +469,6 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv) trace_argv_printf(argv, "trace: built-in: git"); trace2_cmd_name(p->cmd); - trace2_cmd_list_config(); - trace2_cmd_list_env_vars(); validate_cache_entries(the_repository->index); status = p->fn(argc, argv, prefix);