Git.pm: revert _temp_cache use of temp_is_locked
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>
Kyle J. McKay committed
Jul 18, 2013 at 17:16 UTC
9c0810732c50106d1a93866ca3fa1285e07778f1
1 file changed
+1
-1
perl/Git.pm
+1
-1
@@ -1277,7 +1277,7 @@ sub _temp_cache {
1277
1278
my $temp_fd = \$TEMP_FILEMAP{$name};
1279
if (defined $$temp_fd and $$temp_fd->opened) {
1280
- if (temp_is_locked($name)) {
1280
+ if ($TEMP_FILES{$$temp_fd}{locked}) {
1281
throw Error::Simple("Temp file with moniker '" .
1282
$name . "' already in use");
1283
}