mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
8244d01de6
commit
e2f6f76585
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user