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>
Célestin Matte committed
Jun 14, 2013 at 15:50 UTC
ee25ff2c978799519b7705ce1f1d786618ead8d8
1 file changed
+2
-1
contrib/mw-to-git/git-remote-mediawiki.perl
+2
-1
@@ -337,7 +337,8 @@ sub get_mw_pages {
337
sub run_git {
338
my $args = shift;
339
my $encoding = (shift || "encoding(UTF-8)");
340
- open(my $git, "-|:$encoding", "git " . $args);
340
+ open(my $git, "-|:$encoding", "git " . $args)
341
+ or die "Unable to open: $!\n";
342
my $res = do {
343
local $/ = undef;
344
<$git>