Skip to content

Commit cd1a74f

Browse files
committed
fixup! tests: replace mingw_test_cmp with a helper in C
1 parent 63f4efb commit cd1a74f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

t/helper/test-cmp.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ static int run_diff(const char *path1, const char *path2)
1111
"diff", "--no-index", NULL, NULL, NULL
1212
};
1313
const char *env[] = {
14-
"GIT_PAGER=cat", NULL
14+
"GIT_PAGER=cat",
15+
"GIT_DIR=/dev/null",
16+
"HOME=/dev/null",
17+
NULL
1518
};
1619

1720
argv[2] = path1;
@@ -48,7 +51,10 @@ int cmd__cmp(int argc, const char **argv)
4851
if (r1 == EOF)
4952
return 0;
5053
cmp_failed:
51-
return !!run_diff(argv[1], argv[2]);
54+
if (!run_diff(argv[1], argv[2]))
55+
die("Huh? 'diff --no-index %s %s' succeeded",
56+
argv[1], argv[2]);
57+
return 1;
5258
}
5359
if (r1 == EOF || strbuf_cmp(&b0, &b1)) {
5460
fclose(f0);

0 commit comments

Comments
 (0)