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>
Matt Kraai committed
Dec 18, 2012 at 14:03 UTC
9dacffc04009529b37c94de9a26420f640cf3f59
1 file changed
+1
-2
builtin/fetch-pack.c
+1
-2
@@ -875,8 +875,6 @@ static int fetch_pack_config(const char *var, const char *value, void *cb)
875
return git_default_config(var, value, cb);
876
}
877
878
-static struct lock_file lock;
879
-
878
static void fetch_pack_setup(void)
879
{
880
static int did_setup;
@@ -1069,6 +1067,7 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args,
1067
ref_cpy = do_fetch_pack(fd, ref, sought, pack_lockfile);
1068
1069
if (args.depth > 0) {
1070
+ static struct lock_file lock;
1071
struct cache_time mtime;
1072
struct strbuf sb = STRBUF_INIT;
1073
char *shallow = git_path("shallow");