Skip to content

Commit

Permalink
Git.pm: revert _temp_cache use of temp_is_locked
Browse files Browse the repository at this point in the history
When the temp_is_locked function was introduced, there was
a desire to make _temp_cache use it.  Unfortunately due to the
various tests and logic flow involved changing the _temp_cache
function to use the new temp_is_locked function is problematic
as _temp_cache needs a slightly different test than is provided
by the temp_is_locked function.

This change reverts use of temp_is_locked in the _temp_cache
function and restores the original code that existed there
before the temp_is_locked function was added.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
mackyle authored and gitster committed Jul 19, 2013
1 parent 8ac251b commit 9c08107
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion perl/Git.pm
Expand Up @@ -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");
}
Expand Down

0 comments on commit 9c08107

Please sign in to comment.