Re: [PATCH v2 14/22] git-remote-mediawiki: Check return value of open + remove import of unused open2
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jun 8, 2013, 00:14 UTC
- Message-ID
- <CAPig+cQHPjjpt_JYHjua6VWzTjTFog9VzhpD0hOLKSPCrEnEdg@mail.gmail.com>
- In-Reply-To
- <1370641344-4253-15-git-send-email-celestin.matte@ensimag.fr>
On Fri, Jun 7, 2013 at 5:42 PM, Célestin Matte <celestin.matte@ensimag.fr> wrote:
Show 28 quoted lines
> Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
> Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
> ---
> contrib/mw-to-git/git-remote-mediawiki.perl | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/mw-to-git/git-remote-mediawiki.perl b/contrib/mw-to-git/git-remote-mediawiki.perl
> index ae6dd2e..1c34ada 100755
> --- a/contrib/mw-to-git/git-remote-mediawiki.perl
> +++ b/contrib/mw-to-git/git-remote-mediawiki.perl
> @@ -22,7 +22,6 @@ binmode STDERR, ":encoding(UTF-8)";
> binmode STDOUT, ":encoding(UTF-8)";
>
> use URI::Escape;
> -use IPC::Open2;
> use Readonly;
>
> # Mediawiki filenames can contain forward slashes. This variable decides by which pattern they should be replaced
> @@ -338,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>These two changes are unrelated and could be split into distinct patches (IMHO, though others may disagree).