mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
Git.pm: add specified name to tempfile template
This should help me track down errors in git-svn more easily: write .git/Git_XXXXXX: Bad file descriptor at /usr/lib/perl5/SVN/Ra.pm line 623 Signed-off-by: Eric Wong <normalperson@yhbt.net>
This commit is contained in:
parent
7676aff709
commit
822aaf0f08
|
@ -1294,8 +1294,11 @@ sub _temp_cache {
|
|||
$tmpdir = $self->repo_path();
|
||||
}
|
||||
|
||||
my $n = $name;
|
||||
$n =~ s/\W/_/g; # no strange chars
|
||||
|
||||
($$temp_fd, $fname) = File::Temp::tempfile(
|
||||
'Git_XXXXXX', UNLINK => 1, DIR => $tmpdir,
|
||||
"Git_${n}_XXXXXX", UNLINK => 1, DIR => $tmpdir,
|
||||
) or throw Error::Simple("couldn't open new temp file");
|
||||
|
||||
$$temp_fd->autoflush;
|
||||
|
|
Loading…
Reference in a new issue