Skip to content

Commit 822aaf0

Browse files
author
Eric Wong
committed
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 <[email protected]>
1 parent 7676aff commit 822aaf0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

perl/Git.pm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,8 +1294,11 @@ sub _temp_cache {
12941294
$tmpdir = $self->repo_path();
12951295
}
12961296

1297+
my $n = $name;
1298+
$n =~ s/\W/_/g; # no strange chars
1299+
12971300
($$temp_fd, $fname) = File::Temp::tempfile(
1298-
'Git_XXXXXX', UNLINK => 1, DIR => $tmpdir,
1301+
"Git_${n}_XXXXXX", UNLINK => 1, DIR => $tmpdir,
12991302
) or throw Error::Simple("couldn't open new temp file");
13001303

13011304
$$temp_fd->autoflush;

0 commit comments

Comments
 (0)