diff options
author | Jeff King <peff@peff.net> | 2009-12-30 05:53:16 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-01 17:53:46 -0800 |
commit | 8dba1e634af1d973a47fca616a63e7062a256790 (patch) | |
tree | 377f420098f214f106fddb395f7280c0336b48b9 /run-command.h | |
parent | 902f235378cb2b2f6dd5dd664b9630c95321f0ae (diff) | |
download | git-8dba1e634af1d973a47fca616a63e7062a256790.tar.gz |
run-command: add "use shell" option
Many callsites run "sh -c $CMD" to run $CMD. We can make it
a little simpler for them by factoring out the munging of
argv.
For simple cases with no arguments, this doesn't help much, but:
1. For cases with arguments, we save the caller from
having to build the appropriate shell snippet.
2. We can later optimize to avoid the shell when
there are no metacharacters in the program.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'run-command.h')
-rw-r--r-- | run-command.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/run-command.h b/run-command.h index fb342090e3..967ba8cc09 100644 --- a/run-command.h +++ b/run-command.h @@ -33,6 +33,7 @@ struct child_process { unsigned git_cmd:1; /* if this is to be git sub-command */ unsigned silent_exec_failure:1; unsigned stdout_to_stderr:1; + unsigned use_shell:1; void (*preexec_cb)(void); }; @@ -46,6 +47,7 @@ extern int run_hook(const char *index_file, const char *name, ...); #define RUN_GIT_CMD 2 /*If this is to be git sub-command */ #define RUN_COMMAND_STDOUT_TO_STDERR 4 #define RUN_SILENT_EXEC_FAILURE 8 +#define RUN_USING_SHELL 16 int run_command_v_opt(const char **argv, int opt); /* |