Skip to content

Commit

Permalink
Git.pm: add specified name to tempfile template
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Eric Wong committed Oct 29, 2014
1 parent 7676aff commit 822aaf0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion perl/Git.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 822aaf0

Please sign in to comment.