git: avoid calling aliased builtins via their dashed form

This is one of the few places where Git violates its own deprecation of
the dashed form. It is not necessary, either.

As of 595d59e2b5 (git.c: ignore pager.* when launching builtin as
dashed external, 2017-08-02), Git wants to ignore the pager.* config
setting when expanding aliases. So let's strip out the
check_pager_config(<command-name>) call from the copy-edited code.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2016-11-28 18:17:49 +01:00
Родитель 5a16004d2f
Коммит c7a5533c9a
1 изменённых файлов: 25 добавлений и 0 удалений

25
git.c
Просмотреть файл

@ -740,6 +740,31 @@ static int run_argv(int *argcp, const char ***argv)
*/
if (!done_alias)
handle_builtin(*argcp, *argv);
else if (get_builtin(**argv)) {
struct argv_array args = ARGV_ARRAY_INIT;
int i;
if (get_super_prefix())
die("%s doesn't support --super-prefix", **argv);
commit_pager_choice();
argv_array_push(&args, "git");
for (i = 0; i < *argcp; i++)
argv_array_push(&args, (*argv)[i]);
trace_argv_printf(args.argv, "trace: exec:");
/*
* if we fail because the command is not found, it is
* OK to return. Otherwise, we just pass along the status code.
*/
i = run_command_v_opt(args.argv, RUN_SILENT_EXEC_FAILURE |
RUN_CLEAN_ON_EXIT);
if (i >= 0 || errno != ENOENT)
exit(i);
die("could not execute builtin %s", **argv);
}
#if 0 // TODO In GFW, need to amend a7924b655e940b06cb547c235d6bed9767929673 to include trace2_ and _tr2 lines.
else if (get_builtin(**argv)) {