Merge branch 'jk/maint-config-alias-fix' into maint
* jk/maint-config-alias-fix:
handle_options(): do not miscount how many arguments were used
config: always parse GIT_CONFIG_PARAMETERS during git_config
git_config: don't peek at global config_parameters
config: make environment parsing routines static
static int handle_options(const char ***argv, int *argc, int *envchanged)
{
int handled = 0;
const char **orig_argv = *argv;
while (*argc > 0) {
const char *cmd = (*argv)[0];
@ -116,7 +116,6 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
@@ -116,7 +116,6 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
*envchanged = 1;
(*argv)++;
(*argc)--;
handled++;
} else if (!prefixcmp(cmd, "--git-dir=")) {
setenv(GIT_DIR_ENVIRONMENT, cmd + 10, 1);
if (envchanged)
@ -156,9 +155,8 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
@@ -156,9 +155,8 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
(*argv)++;
(*argc)--;
handled++;
}
return handled;
return (*argv) - orig_argv;
}
static int handle_alias(int *argcp, const char ***argv)