Code

Add git_config_early()
[git.git] / git.c
diff --git a/git.c b/git.c
index 8de48107e0dced316704c1ad78569ccb9eeebb08..6793178210db64ae59d3a4d401f32d6d3bd5b1a1 100644 (file)
--- a/git.c
+++ b/git.c
@@ -1,18 +1,19 @@
 #include "builtin.h"
-#include "exec_cmd.h"
 #include "cache.h"
+#include "exec_cmd.h"
+#include "help.h"
 #include "quote.h"
 #include "run-command.h"
 
 const char git_usage_string[] =
-       "git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]\n"
+       "git [--version] [--exec-path[=<path>]] [--html-path]\n"
        "           [-p|--paginate|--no-pager] [--no-replace-objects]\n"
-       "           [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]\n"
+       "           [--bare] [--git-dir=<path>] [--work-tree=<path>]\n"
        "           [-c name=value] [--help]\n"
-       "           COMMAND [ARGS]";
+       "           <command> [<args>]";
 
 const char git_more_info_string[] =
-       "See 'git help COMMAND' for more information on a specific command.";
+       "See 'git help <command>' for more information on a specific command.";
 
 static struct startup_info git_startup_info;
 static int use_pager = -1;
@@ -56,9 +57,6 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
 {
        int handled = 0;
 
-       if (!getenv("GIT_ASKPASS") && getenv("SSH_ASKPASS"))
-               setenv("GIT_ASKPASS", getenv("SSH_ASKPASS"), 1);
-
        while (*argc > 0) {
                const char *cmd = (*argv)[0];
                if (cmd[0] != '-')
@@ -137,7 +135,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
                                fprintf(stderr, "-c expects a configuration string\n" );
                                usage(git_usage_string);
                        }
-                       git_config_parse_parameter((*argv)[1]);
+                       git_config_push_parameter((*argv)[1]);
                        (*argv)++;
                        (*argc)--;
                } else {
@@ -266,6 +264,10 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
                        use_pager = check_pager_config(p->cmd);
                if (use_pager == -1 && p->option & USE_PAGER)
                        use_pager = 1;
+
+               if ((p->option & (RUN_SETUP | RUN_SETUP_GENTLY)) &&
+                   startup_info->have_repository) /* get_git_dir() may set up repo, avoid that */
+                       trace_repo_setup(prefix);
        }
        commit_pager_choice();