summaryrefslogtreecommitdiff
path: root/perl
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2018-03-03 15:38:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-05 18:52:27 (GMT)
commit29118b37eb8510dc42dd94e127f7c92d05963d1d (patch)
tree1393c6f1ad4603cd23a47d5261f8a3708b5ad106 /perl
parent7d5b30e09fc705b84bba57ac655263ab6d8f71a6 (diff)
downloadgit-29118b37eb8510dc42dd94e127f7c92d05963d1d.zip
git-29118b37eb8510dc42dd94e127f7c92d05963d1d.tar.gz
git-29118b37eb8510dc42dd94e127f7c92d05963d1d.tar.bz2
Git.pm: hard-depend on the File::{Temp,Spec} modules
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 <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'perl')
-rw-r--r--perl/Git.pm10
1 files changed, 2 insertions, 8 deletions
diff --git a/perl/Git.pm b/perl/Git.pm
index 7ec16e6..151b0e7 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<FILEHANDLE>.