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 <l.s.r@web.de> Signed-off-by: Taylor Blau <me@ttaylorr.com>

René Scharfe committed Oct 30, 2022 at 12:53 UTC ef249b398e26dd76f473ce83a35219c520f6fdbe
2 files changed +1 -19
run-command.c
-10
@@ -1005,12 +1005,6 @@ int run_command(struct child_process *cmd)
1005 }
1006
1007 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)
1008 {
1009 struct child_process cmd = CHILD_PROCESS_INIT;
1010 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,
1016 cmd.clean_on_exit = opt & RUN_CLEAN_ON_EXIT ? 1 : 0;
1017 cmd.wait_after_clean = opt & RUN_WAIT_AFTER_CLEAN ? 1 : 0;
1018 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;
1019 return run_command(&cmd);
1020 }
1021
run-command.h
+1 -9
@@ -233,23 +233,15 @@ int run_auto_maintenance(int quiet);
233 #define RUN_CLOSE_OBJECT_STORE (1<<7)
234
235 /**
236 - * Convenience functions that encapsulate a sequence of
236 + * Convenience function that encapsulates a sequence of
237 * start_command() followed by finish_command(). The argument argv
238 * specifies the program and its arguments. The argument opt is zero
239 * or more of the flags `RUN_COMMAND_NO_STDIN`, `RUN_GIT_CMD`,
240 * `RUN_COMMAND_STDOUT_TO_STDERR`, or `RUN_SILENT_EXEC_FAILURE`
241 * that correspond to the members .no_stdin, .git_cmd,
242 * .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.
243 */
244 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);
245
246 /**
247 * Execute the given command, sending "in" to its stdin, and capturing its