From 6103d58b7fa335b5f26281ad2c3c90de5680a0c4 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Thu, 6 Aug 2020 00:16:50 +0000 Subject: git-cvsexportcommit: support Perl before 5.10.1 The change in 6e9c4d408d ("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 Signed-off-by: Junio C Hamano diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl index 6483d79..0ae8bce 100755 --- a/git-cvsexportcommit.perl +++ b/git-cvsexportcommit.perl @@ -22,7 +22,7 @@ die "Need at least one commit identifier!" unless @ARGV; 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; -- cgit v0.10.2-6-g49f6