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>
Ævar Arnfjörð Bjarmason committed
Mar 3, 2018 at 15:38 UTC
29118b37eb8510dc42dd94e127f7c92d05963d1d
1 file changed
+2
-8
perl/Git.pm
+2
-8
@@ -11,6 +11,8 @@ use 5.008;
11
use strict;
12
use warnings;
13
14
+use File::Temp ();
15
+use File::Spec ();
16
17
BEGIN {
18
@@ -190,7 +192,6 @@ sub repository {
192
};
193
194
if ($dir) {
193
- _verify_require();
195
File::Spec->file_name_is_absolute($dir) or $dir = $opts{Directory} . '/' . $dir;
196
$opts{Repository} = abs_path($dir);
197
@@ -1289,8 +1290,6 @@ sub temp_release {
1290
sub _temp_cache {
1291
my ($self, $name) = _maybe_self(@_);
1292
1292
- _verify_require();
1293
-
1293
my $temp_fd = \$TEMP_FILEMAP{$name};
1294
if (defined $$temp_fd and $$temp_fd->opened) {
1295
if ($TEMP_FILES{$$temp_fd}{locked}) {
@@ -1324,11 +1323,6 @@ sub _temp_cache {
1323
$$temp_fd;
1324
}
1325
1327
-sub _verify_require {
1328
- eval { require File::Temp; require File::Spec; };
1329
- $@ and throw Error::Simple($@);
1330
-}
1331
-
1326
=item temp_reset ( FILEHANDLE )
1327
1328
Truncates and resets the position of the C<FILEHANDLE>.