aboutsummaryrefslogtreecommitdiff
path: root/builtin/for-each-repo.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/for-each-repo.c')
-rw-r--r--builtin/for-each-repo.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/for-each-repo.c b/builtin/for-each-repo.c
index 325a7925f1..927d3d92da 100644
--- a/builtin/for-each-repo.c
+++ b/builtin/for-each-repo.c
@@ -2,6 +2,7 @@
#include "builtin.h"
#include "config.h"
+#include "environment.h"
#include "gettext.h"
#include "parse-options.h"
#include "path.h"
@@ -13,17 +14,16 @@ static const char * const for_each_repo_usage[] = {
NULL
};
-static int run_command_on_repo(const char *path, int argc, const char ** argv)
+static int run_command_on_repo(const char *path, const char **argv)
{
- int i;
struct child_process child = CHILD_PROCESS_INIT;
char *abspath = interpolate_path(path, 0);
+ sanitize_repo_env(&child.env);
+
child.git_cmd = 1;
strvec_pushl(&child.args, "-C", abspath, NULL);
-
- for (i = 0; i < argc; i++)
- strvec_push(&child.args, argv[i]);
+ strvec_pushv(&child.args, argv);
free(abspath);
@@ -63,7 +63,7 @@ int cmd_for_each_repo(int argc,
return 0;
for (size_t i = 0; i < values->nr; i++) {
- int ret = run_command_on_repo(values->items[i].string, argc, argv);
+ int ret = run_command_on_repo(values->items[i].string, argv);
if (ret) {
if (!keep_going)
return ret;