From 29118b37eb8510dc42dd94e127f7c92d05963d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 3 Mar 2018 15:38:09 +0000 Subject: Git.pm: hard-depend on the File::{Temp,Spec} modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since my d48b284183 ("perl: bump the required Perl version to 5.8 from 5.6.[21]", 2010-09-24), we've depended on 5.8, so there's no reason to conditionally require File::Temp and File::Spec anymore. They were first released with perl versions v5.6.1 and 5.00405, respectively. This code was originally added in c14c8ceb13 ("Git.pm: Make File::Spec and File::Temp requirement lazy", 2008-08-15), presumably to make Git.pm work on 5.6.0. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- perl/Git.pm | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'perl/Git.pm') diff --git a/perl/Git.pm b/perl/Git.pm index 7ec16e6dde..151b0e7144 100644 --- a/perl/Git.pm +++ b/perl/Git.pm @@ -11,6 +11,8 @@ use 5.008; use strict; use warnings; +use File::Temp (); +use File::Spec (); BEGIN { @@ -190,7 +192,6 @@ sub repository { }; if ($dir) { - _verify_require(); File::Spec->file_name_is_absolute($dir) or $dir = $opts{Directory} . '/' . $dir; $opts{Repository} = abs_path($dir); @@ -1289,8 +1290,6 @@ sub temp_release { sub _temp_cache { my ($self, $name) = _maybe_self(@_); - _verify_require(); - my $temp_fd = \$TEMP_FILEMAP{$name}; if (defined $$temp_fd and $$temp_fd->opened) { if ($TEMP_FILES{$$temp_fd}{locked}) { @@ -1324,11 +1323,6 @@ sub _temp_cache { $$temp_fd; } -sub _verify_require { - eval { require File::Temp; require File::Spec; }; - $@ and throw Error::Simple($@); -} - =item temp_reset ( FILEHANDLE ) Truncates and resets the position of the C. -- cgit v1.2.3