From e2f6f7658559246ea03015fc7b999af2cd20c122 Mon Sep 17 00:00:00 2001 From: Karthik Nayak Date: Sun, 19 Jan 2025 12:19:27 +0100 Subject: pack-write: pass repository to `index_pack_lockfile()` The `index_pack_lockfile()` function uses the global `the_repository` variable to access the repository. To avoid global variable usage, pass the repository from the layers above. Altough the layers above could have access to the repository internally, simply pass in `the_repository`. This avoids any compatibility issues and bubbles up global variable usage to upper layers which can be eventually resolved. Signed-off-by: Karthik Nayak Signed-off-by: Junio C Hamano --- fetch-pack.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fetch-pack.c') diff --git a/fetch-pack.c b/fetch-pack.c index 3a227721ed..824f56ecbc 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -1036,7 +1036,9 @@ static int get_pack(struct fetch_pack_args *args, die(_("fetch-pack: unable to fork off %s"), cmd_name); if (do_keep && (pack_lockfiles || fsck_objects)) { int is_well_formed; - char *pack_lockfile = index_pack_lockfile(cmd.out, &is_well_formed); + char *pack_lockfile = index_pack_lockfile(the_repository, + cmd.out, + &is_well_formed); if (!is_well_formed) die(_("fetch-pack: invalid index-pack output")); -- cgit v1.2.3