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

[PATCH 1/2] Make lock local to fetch_pack

From
MKMatt Kraai <kraai@ftbfs.org>
Date
Dec 14, 2012, 18:38 UTC
Message-ID
<1355510300-31541-2-git-send-email-kraai@ftbfs.org>
In-Reply-To
<1355510300-31541-1-git-send-email-kraai@ftbfs.org>
From: Matt Kraai <matt.kraai@amo.abbott.com>
lock is only used by fetch_pack, so move it into that function.
Signed-off-by: Matt Kraai <matt.kraai@amo.abbott.com>
---
 fetch-pack.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fetch-pack.c b/fetch-pack.c
index 099ff4d..9d9762d 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -874,8 +874,6 @@ static int fetch_pack_config(const char *var, const char *value, void *cb)
 	return git_default_config(var, value, cb);
 }
 
-static struct lock_file lock;
-
 static void fetch_pack_setup(void)
 {
 	static int did_setup;
@@ -896,6 +894,7 @@ struct ref *fetch_pack(struct fetch_pack_args *args,
 		       struct string_list *sought,
 		       char **pack_lockfile)
 {
+	static struct lock_file lock;
 	struct stat st;
 	struct ref *ref_cpy;
 
-- 
1.8.1-rc1
Previous: Matt KraaiNext: Junio C Hamano
Message 2 of 8 in “Port to QNX”
  1. 0/2 Port to QNXMatt Kraai, Dec 14, 2012
  2. 1/2 Make lock local to fetch_packMatt Kraai, Dec 14, 2012
  3. Junio C HamanoDec 15, 2012
  4. Junio C HamanoDec 15, 2012
  5. 2/2 Port to QNXMatt Kraai, Dec 14, 2012
  6. Joachim SchmitzDec 16, 2012
  7. Junio C HamanoDec 15, 2012
  8. Matt KraaiDec 15, 2012

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.