1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-18 21:46:26 +02:00

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>
This commit is contained in:
Ævar Arnfjörð Bjarmason 2018-03-03 15:38:09 +00:00 committed by Junio C Hamano
parent 7d5b30e09f
commit 29118b37eb

View File

@ -11,6 +11,8 @@ package Git;
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>.