summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3b16739)
raw | patch | inline | side by side (parent: 3b16739)
author | Johannes Schindelin <johannes.schindelin@gmx.de> | |
Sat, 7 Mar 2009 15:51:33 +0000 (16:51 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 8 Mar 2009 04:36:16 +0000 (20:36 -0800) |
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>
bash converts the "/dev/null" to a "nul", which usually makes sense. But
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-no-index.c | patch | blob | history | |
t/t4012-diff-binary.sh | patch | blob | history |
diff --git a/diff-no-index.c b/diff-no-index.c
index 0a14268ba952da5ff66be753cc0cc147ba64ee2b..598687b50ac7b88ca0860faf1670d03047bb3603 100644 (file)
--- a/diff-no-index.c
+++ b/diff-no-index.c
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 3cf5b5c4ea05d861d75aa146a52d7d273dcaa4cb..f64aa48d24f2f5704d07b9285c94ba983f7d92ac 100755 (executable)
--- a/t/t4012-diff-binary.sh
+++ b/t/t4012-diff-binary.sh
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
) &&