Skip to content

Commit 9dacffc

Browse files
Matt Kraaigitster
authored andcommitted
Make lock local to fetch_pack
lock is only used by fetch_pack, so move it into that function. Signed-off-by: Matt Kraai <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b2d05e0 commit 9dacffc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

builtin/fetch-pack.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,8 +875,6 @@ static int fetch_pack_config(const char *var, const char *value, void *cb)
875875
return git_default_config(var, value, cb);
876876
}
877877

878-
static struct lock_file lock;
879-
880878
static void fetch_pack_setup(void)
881879
{
882880
static int did_setup;
@@ -1069,6 +1067,7 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args,
10691067
ref_cpy = do_fetch_pack(fd, ref, sought, pack_lockfile);
10701068

10711069
if (args.depth > 0) {
1070+
static struct lock_file lock;
10721071
struct cache_time mtime;
10731072
struct strbuf sb = STRBUF_INIT;
10741073
char *shallow = git_path("shallow");

0 commit comments

Comments
 (0)