Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
Diffstat (limited to 'git.c')
-rw-r--r--git.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/git.c b/git.c
index 6ed824cacf..e61a59c014 100644
--- a/git.c
+++ b/git.c
@@ -239,19 +239,15 @@ static int handle_alias(int *argcp, const char ***argv)
alias_string = alias_lookup(alias_command);
if (alias_string) {
if (alias_string[0] == '!') {
- const char **alias_argv;
- int argc = *argcp, i;
+ struct child_process child = CHILD_PROCESS_INIT;
commit_pager_choice();
- /* build alias_argv */
- alias_argv = xmalloc(sizeof(*alias_argv) * (argc + 1));
- alias_argv[0] = alias_string + 1;
- for (i = 1; i < argc; ++i)
- alias_argv[i] = (*argv)[i];
- alias_argv[argc] = NULL;
+ child.use_shell = 1;
+ argv_array_push(&child.args, alias_string + 1);
+ argv_array_pushv(&child.args, (*argv) + 1);
- ret = run_command_v_opt(alias_argv, RUN_USING_SHELL);
+ ret = run_command(&child);
if (ret >= 0) /* normal exit */
exit(ret);