send-email: more meaningful Message-ID
[gitweb.git] / perl / Git.pm
index 0ba15b9a5648afcd6fc2dad8c095c6ff1967bcc7..9026a7bb980a984086a62536f46ec3837588f277 100644 (file)
@@ -695,7 +695,7 @@ sub config_path {
 is simple decimal number.  An optional value suffix of 'k', 'm',
 or 'g' in the config file will cause the value to be multiplied
 by 1024, 1048576 (1024^2), or 1073741824 (1024^3) prior to output.
-It would return C<undef> if configuration variable is not defined,
+It would return C<undef> if configuration variable is not defined.
 
 =cut
 
@@ -704,7 +704,7 @@ sub config_int {
 }
 
 # Common subroutine to implement bulk of what the config* family of methods
-# do. This curently wraps command('config') so it is not so fast.
+# do. This currently wraps command('config') so it is not so fast.
 sub _config_common {
        my ($opts) = shift @_;
        my ($self, $var) = _maybe_self(@_);
@@ -1277,7 +1277,7 @@ sub _temp_cache {
 
        my $temp_fd = \$TEMP_FILEMAP{$name};
        if (defined $$temp_fd and $$temp_fd->opened) {
-               if (temp_is_locked($name)) {
+               if ($TEMP_FILES{$$temp_fd}{locked}) {
                        throw Error::Simple("Temp file with moniker '" .
                                $name . "' already in use");
                }
@@ -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;