Git.pm: hard-depend on the File::{Temp,Spec} modules
Since myd48b284183
("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 inc14c8ceb13
("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:
parent
7d5b30e09f
commit
29118b37eb
10
perl/Git.pm
10
perl/Git.pm
@ -11,6 +11,8 @@ use 5.008;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
|
use File::Temp ();
|
||||||
|
use File::Spec ();
|
||||||
|
|
||||||
BEGIN {
|
BEGIN {
|
||||||
|
|
||||||
@ -190,7 +192,6 @@ sub repository {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if ($dir) {
|
if ($dir) {
|
||||||
_verify_require();
|
|
||||||
File::Spec->file_name_is_absolute($dir) or $dir = $opts{Directory} . '/' . $dir;
|
File::Spec->file_name_is_absolute($dir) or $dir = $opts{Directory} . '/' . $dir;
|
||||||
$opts{Repository} = abs_path($dir);
|
$opts{Repository} = abs_path($dir);
|
||||||
|
|
||||||
@ -1289,8 +1290,6 @@ sub temp_release {
|
|||||||
sub _temp_cache {
|
sub _temp_cache {
|
||||||
my ($self, $name) = _maybe_self(@_);
|
my ($self, $name) = _maybe_self(@_);
|
||||||
|
|
||||||
_verify_require();
|
|
||||||
|
|
||||||
my $temp_fd = \$TEMP_FILEMAP{$name};
|
my $temp_fd = \$TEMP_FILEMAP{$name};
|
||||||
if (defined $$temp_fd and $$temp_fd->opened) {
|
if (defined $$temp_fd and $$temp_fd->opened) {
|
||||||
if ($TEMP_FILES{$$temp_fd}{locked}) {
|
if ($TEMP_FILES{$$temp_fd}{locked}) {
|
||||||
@ -1324,11 +1323,6 @@ sub _temp_cache {
|
|||||||
$$temp_fd;
|
$$temp_fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub _verify_require {
|
|
||||||
eval { require File::Temp; require File::Spec; };
|
|
||||||
$@ and throw Error::Simple($@);
|
|
||||||
}
|
|
||||||
|
|
||||||
=item temp_reset ( FILEHANDLE )
|
=item temp_reset ( FILEHANDLE )
|
||||||
|
|
||||||
Truncates and resets the position of the C<FILEHANDLE>.
|
Truncates and resets the position of the C<FILEHANDLE>.
|
||||||
|
Loading…
Reference in New Issue
Block a user