summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2009-03-07 15:51:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-03-08 04:36:16 (GMT)
commit36adb4abbdf809371b88581c8bf7fe9ea9a5b00a (patch)
treec9f49462da79b147ba69c31e5d2b810b4529e05f
parent3b167396b416541f7559f3141392d56b93ea049c (diff)
downloadgit-36adb4abbdf809371b88581c8bf7fe9ea9a5b00a.zip
git-36adb4abbdf809371b88581c8bf7fe9ea9a5b00a.tar.gz
git-36adb4abbdf809371b88581c8bf7fe9ea9a5b00a.tar.bz2
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>
-rw-r--r--diff-no-index.c4
-rwxr-xr-xt/t4012-diff-binary.sh2
2 files changed, 5 insertions, 1 deletions
diff --git a/diff-no-index.c b/diff-no-index.c
index 0a14268..598687b 100644
--- a/diff-no-index.c
+++ b/diff-no-index.c
@@ -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))
diff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh
index 3cf5b5c..f64aa48 100755
--- a/t/t4012-diff-binary.sh
+++ b/t/t4012-diff-binary.sh
@@ -87,7 +87,7 @@ nul_to_q() {
test_expect_success 'diff --no-index with binary creation' '
echo Q | q_to_nul >binary &&
- (:# hide error code from diff, which just indicates differences
+ (: hide error code from diff, which just indicates differences
git diff --binary --no-index /dev/null binary >current ||
true
) &&