Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-05-19 10:45:26 +0300
committerJunio C Hamano <gitster@pobox.com>2019-05-19 10:45:26 +0300
commit18cfb74f31209007e3a960efa594c25abd8a4cac (patch)
tree1151ef8fbcd62c6463f5594e80603dc9e546e44b /contrib
parent1294160b27d1c673e4ae8b47eba359a8266a623d (diff)
parent6804ba3a58ff2999533af28ca5af3901e30fd1f2 (diff)
Merge branch 'cw/diff-highlight'
Portability fix for a diff-highlight tool (in contrib/). * cw/diff-highlight: diff-highlight: use correct /dev/null for UNIX and Windows
Diffstat (limited to 'contrib')
-rw-r--r--contrib/diff-highlight/DiffHighlight.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/diff-highlight/DiffHighlight.pm b/contrib/diff-highlight/DiffHighlight.pm
index 536754583b..7440aa1c46 100644
--- a/contrib/diff-highlight/DiffHighlight.pm
+++ b/contrib/diff-highlight/DiffHighlight.pm
@@ -4,6 +4,11 @@ use 5.008;
use warnings FATAL => 'all';
use strict;
+# Use the correct value for both UNIX and Windows (/dev/null vs nul)
+use File::Spec;
+
+my $NULL = File::Spec->devnull();
+
# Highlight by reversing foreground and background. You could do
# other things like bold or underline if you prefer.
my @OLD_HIGHLIGHT = (
@@ -134,7 +139,7 @@ sub highlight_stdin {
# fallback, which means we will work even if git can't be run.
sub color_config {
my ($key, $default) = @_;
- my $s = `git config --get-color $key 2>/dev/null`;
+ my $s = `git config --get-color $key 2>$NULL`;
return length($s) ? $s : $default;
}