diff options
| author | Karthik Nayak <karthik.188@gmail.com> | 2025-01-19 12:19:27 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-01-21 12:36:34 -0800 |
| commit | e2f6f7658559246ea03015fc7b999af2cd20c122 (patch) | |
| tree | cd93091d749f4fe25bb6af929fa81fb672536bd8 /fetch-pack.c | |
| parent | pack-write: pass hash_algo to `fixup_pack_header_footer()` (diff) | |
| download | git-e2f6f7658559246ea03015fc7b999af2cd20c122.tar.gz git-e2f6f7658559246ea03015fc7b999af2cd20c122.zip | |
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 <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fetch-pack.c')
| -rw-r--r-- | fetch-pack.c | 4 |
1 files changed, 3 insertions, 1 deletions
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")); |
