Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

Re: [PATCH] MinGW: fix diff --no-index /dev/null ...

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:21

Possibly related (same subject, not in this thread)

Johannes Schindelin [off-list ref] writes:
quoted hunk ↗ jump to hunk
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))
I had a brief "Huh? -- doesn't this call for an is_dev_null() helper"
moment, but I think you are right that diff-no-index.c is the right place
to special case it.

Should this go to 'maint'?
quoted hunk ↗ jump to hunk
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
 	) &&
-- 
1.6.2.327.g0fa6c
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help