mirror of
https://github.com/git/git.git
synced 2026-02-03 06:21:39 +00:00
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 <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user