diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-15 12:40:41 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-15 12:40:41 -0700 |
commit | d809d050ffe332cdd91281ad6b01e8363e417ec8 (patch) | |
tree | b48d5bd19a7cd6008d01488cf396b5f3fe208178 /t | |
parent | 85e7e81ccfcec98972e341ab81b0109084b84906 (diff) | |
parent | a749c0bbef068af339ea1ac8843f8ca307b3dd35 (diff) | |
download | git-d809d050ffe332cdd91281ad6b01e8363e417ec8.tar.gz |
Merge branch 'tr/perl-keep-stderr-open'
Closing (not redirecting to /dev/null) the standard error stream is
not a very smart thing to do. Later open may return file
descriptor #2 for unrelated purpose, and error reporting code may
write into them.
* tr/perl-keep-stderr-open:
t9700: do not close STDERR
perl: redirect stderr to /dev/null instead of closing
Diffstat (limited to 't')
-rwxr-xr-x | t/t9700/test.pl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t9700/test.pl b/t/t9700/test.pl index 0d4e366232..1140767b50 100755 --- a/t/t9700/test.pl +++ b/t/t9700/test.pl @@ -45,7 +45,8 @@ is($r->get_color("color.test.slot1", "red"), $ansi_green, "get_color"); # Failure cases for config: # Save and restore STDERR; we will probably extract this into a # "dies_ok" method and possibly move the STDERR handling to Git.pm. -open our $tmpstderr, ">&STDERR" or die "cannot save STDERR"; close STDERR; +open our $tmpstderr, ">&STDERR" or die "cannot save STDERR"; +open STDERR, ">", "/dev/null" or die "cannot redirect STDERR to /dev/null"; is($r->config("test.dupstring"), "value2", "config: multivar"); eval { $r->config_bool("test.boolother") }; ok($@, "config_bool: non-boolean values fail"); |