]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Git.pm: call tempfile from File::Temp as a regular function
authorH. Merijn Brand <h.m.brand@xs4all.nl>
Mon, 29 Apr 2013 08:09:57 +0000 (01:09 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Apr 2013 08:10:26 +0000 (01:10 -0700)
We call File::Temp's "tempfile" function as a class method, but it was
never designed to be called this way. Older versions seemed to
tolerate it, but as of File::Temp 0.23, it blows up like this:

  $ git svn fetch
  'tempfile' can't be called as a method at .../Git.pm line 1117.

Fix it by calling it as a regular function, just inside the File::Temp
namespace.

Signed-off-by: H. Merijn Brand <h.m.brand@xs4all.nl>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
perl/Git.pm

index 497f420178a73061901393f8c21a9feb17054b6d..76383b987e72b5fca16c2d68bfb87cf69b86e510 100644 (file)
@@ -1039,7 +1039,7 @@ sub _temp_cache {
                        $tmpdir = $self->repo_path();
                }
 
-               ($$temp_fd, $fname) = File::Temp->tempfile(
+               ($$temp_fd, $fname) = File::Temp::tempfile(
                        'Git_XXXXXX', UNLINK => 1, DIR => $tmpdir,
                        ) or throw Error::Simple("couldn't open new temp file");