Skip to content

Commit 9166ff1

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
fixup??? tests: replace mingw_test_cmp with a helper in C
Needed by `rs/no-more-run-command-v`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 51f7c7d commit 9166ff1

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

t/helper/test-cmp.c

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,14 @@
1313

1414
static int run_diff(const char *path1, const char *path2)
1515
{
16-
const char *argv[] = {
17-
"diff", "--no-index", NULL, NULL, NULL
18-
};
19-
const char *env[] = {
20-
"GIT_PAGER=cat",
21-
"GIT_DIR=" NO_SUCH_DIR,
22-
"HOME=" NO_SUCH_DIR,
23-
NULL
24-
};
16+
struct child_process cmd = CHILD_PROCESS_INIT;
2517

26-
argv[2] = path1;
27-
argv[3] = path2;
28-
return run_command_v_opt_cd_env(argv,
29-
RUN_COMMAND_NO_STDIN | RUN_GIT_CMD,
30-
NULL, env);
18+
cmd.git_cmd = 1;
19+
cmd.no_stdin = 1;
20+
strvec_pushl(&cmd.args, "diff", "--no-index", path1, path2, NULL);
21+
strvec_pushl(&cmd.env, "GIT_PAGER=cat", "GIT_DIR=" NO_SUCH_DIR,
22+
"HOME=" NO_SUCH_DIR, NULL);
23+
return run_command(&cmd);
3124
}
3225

3326
int cmd__cmp(int argc, const char **argv)

0 commit comments

Comments
 (0)