public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH] Git.pm: add specified name to tempfile template
@ 2014-10-29 19:31 Eric Wong
  2014-10-29 19:50 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Wong @ 2014-10-29 19:31 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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>
---
  Not sure you want to take this separately or in a git-svn pull.
  Still working on the error this patch is meant to help me find.

 perl/Git.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/perl/Git.pm b/perl/Git.pm
index 204fdc6..b5905ee 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -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;
-- 
EW

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-29 19:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-29 19:31 [PATCH] Git.pm: add specified name to tempfile template Eric Wong
2014-10-29 19:50 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox