summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <matt.kraai@amo.abbott.com>2012-12-18 14:03:54 -0800
committerJunio C Hamano <gitster@pobox.com>2012-12-19 19:00:00 -0800
commit9dacffc04009529b37c94de9a26420f640cf3f59 (patch)
treec3d87066f661c3a1de055f951c9b24293cb0fcf0
parentb2d05e0653f29a75b57260c4d963d560ad65691b (diff)
downloadgit-9dacffc04009529b37c94de9a26420f640cf3f59.tar.gz
Make lock local to fetch_pack
lock is only used by fetch_pack, so move it into that function. Signed-off-by: Matt Kraai <matt.kraai@amo.abbott.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/fetch-pack.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index e6443986b8..9bc10b3169 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -875,8 +875,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;
@@ -1069,6 +1067,7 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args,
ref_cpy = do_fetch_pack(fd, ref, sought, pack_lockfile);
if (args.depth > 0) {
+ static struct lock_file lock;
struct cache_time mtime;
struct strbuf sb = STRBUF_INIT;
char *shallow = git_path("shallow");