From 7149589c5cd0f70c1d3cf5f3096fee3f34febc3e Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 2 Oct 2018 21:55:11 +0200 Subject: [PATCH] fixup! tests: replace mingw_test_cmp with a helper in C The /dev/null trick does not even work... It makes `git diff --no-index` fail because it tries to access the XDG config as `\\.\GLOBALROOT\Device\Null/.config/git/config`, which is not even a valid path (and therefore the `access_error_is_ok()` check fails). Let's just use a known-missing path on Windows. Signed-off-by: Johannes Schindelin --- 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 98dd079152..1c646a54bf 100644 --- a/t/helper/test-cmp.c +++ b/t/helper/test-cmp.c @@ -5,6 +5,12 @@ #include "parse-options.h" #include "run-command.h" +#ifdef WIN32 +#define NO_SUCH_DIR "\\\\.\\GLOBALROOT\\invalid" +#else +#define NO_SUCH_DIR "/dev/null" +#endif + static int run_diff(const char *path1, const char *path2) { const char *argv[] = { @@ -12,8 +18,8 @@ static int run_diff(const char *path1, const char *path2) }; const char *env[] = { "GIT_PAGER=cat", - "GIT_DIR=/dev/null", - "HOME=/dev/null", + "GIT_DIR=" NO_SUCH_DIR, + "HOME=" NO_SUCH_DIR, NULL };