git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/1] Git.pm: revert _temp_cache use of temp_is_locked

From
Kyle J. McKay <mackyle@gmail.com>
Date
Jul 19, 2013, 00:16 UTC
Message-ID
<7c02d1e993907797fab2731677a1367@f74d39fa044aa309eaea14b9f57fe79>
In-Reply-To
<3e0c11386c2e091f09c554bf0ba091d@f74d39fa044aa309eaea14b9f57fe79>

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>
---
 perl/Git.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/perl/Git.pm b/perl/Git.pm
index 0ba15b9..204fdc6 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -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");
 		}
-- 
1.8.3
Previous: Kyle J. McKay
Message 2 of 2 in “incremental update against 'next' branch”
  1. 0/1 incremental update against 'next' branchKyle J. McKay, Jul 19, 2013
  2. 1/1 Git.pm: revert _temp_cache use of temp_is_lockedKyle J. McKay, Jul 19, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.