Merge branch 'jk/gc-auto-after-fetch'
[git.git] / fetch-pack.c
index b4383c6dca6d10fae3e68a5bd15e094eb3bd1877..6d8926a5504a6cd93e19860f85d58816bdd5c222 100644 (file)
@@ -877,8 +877,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;
@@ -920,6 +918,7 @@ struct ref *fetch_pack(struct fetch_pack_args *args,
        ref_cpy = do_fetch_pack(args, 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");