Skip to content

Commit ef249b3

Browse files
rscharfettaylorr
authored andcommitted
replace and remove run_command_v_opt_cd_env_tr2()
The convenience function run_command_v_opt_cd_env_tr2() has no external callers left. Inline it and remove it from the API. Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent d82dbbd commit ef249b3

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

run-command.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,12 +1005,6 @@ int run_command(struct child_process *cmd)
10051005
}
10061006

10071007
int run_command_v_opt(const char **argv, int opt)
1008-
{
1009-
return run_command_v_opt_cd_env_tr2(argv, opt, NULL, NULL, NULL);
1010-
}
1011-
1012-
int run_command_v_opt_cd_env_tr2(const char **argv, int opt, const char *dir,
1013-
const char *const *env, const char *tr2_class)
10141008
{
10151009
struct child_process cmd = CHILD_PROCESS_INIT;
10161010
strvec_pushv(&cmd.args, argv);
@@ -1022,10 +1016,6 @@ int run_command_v_opt_cd_env_tr2(const char **argv, int opt, const char *dir,
10221016
cmd.clean_on_exit = opt & RUN_CLEAN_ON_EXIT ? 1 : 0;
10231017
cmd.wait_after_clean = opt & RUN_WAIT_AFTER_CLEAN ? 1 : 0;
10241018
cmd.close_object_store = opt & RUN_CLOSE_OBJECT_STORE ? 1 : 0;
1025-
cmd.dir = dir;
1026-
if (env)
1027-
strvec_pushv(&cmd.env, (const char **)env);
1028-
cmd.trace2_child_class = tr2_class;
10291019
return run_command(&cmd);
10301020
}
10311021

run-command.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -233,23 +233,15 @@ int run_auto_maintenance(int quiet);
233233
#define RUN_CLOSE_OBJECT_STORE (1<<7)
234234

235235
/**
236-
* Convenience functions that encapsulate a sequence of
236+
* Convenience function that encapsulates a sequence of
237237
* start_command() followed by finish_command(). The argument argv
238238
* specifies the program and its arguments. The argument opt is zero
239239
* or more of the flags `RUN_COMMAND_NO_STDIN`, `RUN_GIT_CMD`,
240240
* `RUN_COMMAND_STDOUT_TO_STDERR`, or `RUN_SILENT_EXEC_FAILURE`
241241
* that correspond to the members .no_stdin, .git_cmd,
242242
* .stdout_to_stderr, .silent_exec_failure of `struct child_process`.
243-
* The argument dir corresponds the member .dir. The argument env
244-
* corresponds to the member .env.
245243
*/
246244
int run_command_v_opt(const char **argv, int opt);
247-
/*
248-
* env (the environment) is to be formatted like environ: "VAR=VALUE".
249-
* To unset an environment variable use just "VAR".
250-
*/
251-
int run_command_v_opt_cd_env_tr2(const char **argv, int opt, const char *dir,
252-
const char *const *env, const char *tr2_class);
253245

254246
/**
255247
* Execute the given command, sending "in" to its stdin, and capturing its

0 commit comments

Comments
 (0)