From cd1a74fc9dc8a07626c216940db9a51f25206e03 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 22 Jun 2018 11:16:23 +0200 Subject: [PATCH] fixup! tests: replace mingw_test_cmp with a helper in C --- t/helper/test-cmp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/t/helper/test-cmp.c b/t/helper/test-cmp.c index e03047dc6987eb..98dd0791520fe0 100644 --- a/t/helper/test-cmp.c +++ b/t/helper/test-cmp.c @@ -11,7 +11,10 @@ static int run_diff(const char *path1, const char *path2) "diff", "--no-index", NULL, NULL, NULL }; const char *env[] = { - "GIT_PAGER=cat", NULL + "GIT_PAGER=cat", + "GIT_DIR=/dev/null", + "HOME=/dev/null", + NULL }; argv[2] = path1; @@ -48,7 +51,10 @@ int cmd__cmp(int argc, const char **argv) if (r1 == EOF) return 0; cmp_failed: - return !!run_diff(argv[1], argv[2]); + if (!run_diff(argv[1], argv[2])) + die("Huh? 'diff --no-index %s %s' succeeded", + argv[1], argv[2]); + return 1; } if (r1 == EOF || strbuf_cmp(&b0, &b1)) { fclose(f0);