Skip to content

Commit

Permalink
git-cvsexportcommit: support Perl before 5.10.1
Browse files Browse the repository at this point in the history
The change in 6e9c4d4 ("git-cvsexportcommit: port to SHA-256",
2020-06-22) added the use of a temporary directory for the index.
However, the form we used doesn't work in versions of Perl before
5.10.1.  For example, version 5.10.0 contains a version of File::Temp
from 2007 that doesn't contain "newdir".

In order to make the code work with 5.8.8, which we support, let's
change to use the static method "tempdir" with the argument "CLEANUP",
which provides the same behavior.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
bk2204 authored and gitster committed Aug 6, 2020
1 parent 6e9c4d4 commit 6103d58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-cvsexportcommit.perl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
my $repo = Git->repository();
$opt_w = $repo->config('cvsexportcommit.cvsdir') unless defined $opt_w;

my $tmpdir = File::Temp->newdir;
my $tmpdir = File::Temp::tempdir(CLEANUP => 1);
my $hash_algo = $repo->config('extensions.objectformat') || 'sha1';
my $hexsz = $hash_algo eq 'sha256' ? 64 : 40;

Expand Down

0 comments on commit 6103d58

Please sign in to comment.