MinGW: fix diff --no-index /dev/null ...

When launching "diff --no-index" with a parameter "/dev/null", the MSys
bash converts the "/dev/null" to a "nul", which usually makes sense.  But

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin
2009-03-07 16:51:33 +01:00
committed by Junio C Hamano
parent 3b167396b4
commit 36adb4abbd
2 changed files with 5 additions and 1 deletions

View File

@ -38,6 +38,10 @@ static int get_mode(const char *path, int *mode)
if (!path || !strcmp(path, "/dev/null"))
*mode = 0;
#ifdef _WIN32
else if (!strcasecmp(path, "nul"))
*mode = 0;
#endif
else if (!strcmp(path, "-"))
*mode = create_ce_mode(0666);
else if (lstat(path, &st))