setup.c: support multi-checkout repo setup
[gitweb.git] / perl / Git.pm
index 204fdc673754c82637c59992198a2c8d31e05fa8..b5905ee1ad03fe9973e3cf7d46fa29c5cf184215 100644 (file)
@@ -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;