Skip to content

Commit 29118b3

Browse files
avargitster
authored andcommitted
Git.pm: hard-depend on the File::{Temp,Spec} modules
Since my d48b284 ("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 c14c8ce ("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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7d5b30e commit 29118b3

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

perl/Git.pm

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use 5.008;
1111
use strict;
1212
use warnings;
1313

14+
use File::Temp ();
15+
use File::Spec ();
1416

1517
BEGIN {
1618

@@ -190,7 +192,6 @@ sub repository {
190192
};
191193

192194
if ($dir) {
193-
_verify_require();
194195
File::Spec->file_name_is_absolute($dir) or $dir = $opts{Directory} . '/' . $dir;
195196
$opts{Repository} = abs_path($dir);
196197

@@ -1289,8 +1290,6 @@ sub temp_release {
12891290
sub _temp_cache {
12901291
my ($self, $name) = _maybe_self(@_);
12911292

1292-
_verify_require();
1293-
12941293
my $temp_fd = \$TEMP_FILEMAP{$name};
12951294
if (defined $$temp_fd and $$temp_fd->opened) {
12961295
if ($TEMP_FILES{$$temp_fd}{locked}) {
@@ -1324,11 +1323,6 @@ sub _temp_cache {
13241323
$$temp_fd;
13251324
}
13261325

1327-
sub _verify_require {
1328-
eval { require File::Temp; require File::Spec; };
1329-
$@ and throw Error::Simple($@);
1330-
}
1331-
13321326
=item temp_reset ( FILEHANDLE )
13331327
13341328
Truncates and resets the position of the C<FILEHANDLE>.

0 commit comments

Comments
 (0)