git-remote-mediawiki: check return value of open
authorCélestin Matte <celestin.matte@ensimag.fr>
Fri, 14 Jun 2013 13:50:27 +0000 (15:50 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Jun 2013 16:02:17 +0000 (09:02 -0700)
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>
contrib/mw-to-git/git-remote-mediawiki.perl
index d1cddabd69bd5a619c82ac0ecf3a30c35a548c8a..82684f385dc1410fd60d802c967ae663add4b118 100755 (executable)
@@ -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>