We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 685a0c1 + 6804ba3 commit a3b047cCopy full SHA for a3b047c
contrib/diff-highlight/DiffHighlight.pm
@@ -4,6 +4,11 @@ use 5.008;
4
use warnings FATAL => 'all';
5
use strict;
6
7
+# Use the correct value for both UNIX and Windows (/dev/null vs nul)
8
+use File::Spec;
9
+
10
+my $NULL = File::Spec->devnull();
11
12
# Highlight by reversing foreground and background. You could do
13
# other things like bold or underline if you prefer.
14
my @OLD_HIGHLIGHT = (
@@ -134,7 +139,7 @@ sub highlight_stdin {
134
139
# fallback, which means we will work even if git can't be run.
135
140
sub color_config {
136
141
my ($key, $default) = @_;
137
- my $s = `git config --get-color $key 2>/dev/null`;
142
+ my $s = `git config --get-color $key 2>$NULL`;
138
143
return length($s) ? $s : $default;
144
}
145
0 commit comments