git-remote-mediawiki: check return value of open

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Célestin Matte 2013-06-14 15:50:27 +02:00 committed by Junio C Hamano
parent 4f1b7883bc
commit ee25ff2c97

View file

@ -337,7 +337,8 @@ sub get_mw_pages {
sub run_git {
my $args = shift;
my $encoding = (shift || "encoding(UTF-8)");
open(my $git, "-|:$encoding", "git " . $args);
open(my $git, "-|:$encoding", "git " . $args)
or die "Unable to open: $!\n";
my $res = do {
local $/ = undef;
<$git>