aboutsummaryrefslogtreecommitdiffstats
path: root/commit-graph.c
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2024-12-03 15:44:03 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-04 08:21:55 +0900
commite106040722c746346c3c40d3790789d9e196f60d (patch)
treea42675212de9a6305aa6032810df127c95f1ebdd /commit-graph.c
parentconfig: make `packed_git_(limit|window_size)` non-global variables (diff)
downloadgit-e106040722c746346c3c40d3790789d9e196f60d.tar.gz
git-e106040722c746346c3c40d3790789d9e196f60d.zip
midx: add repository to `multi_pack_index` struct
The `multi_pack_index` struct represents the MIDX for a repository. Here, we add a pointer to the repository in this struct, allowing direct use of the repository variable without relying on the global `the_repository` struct. With this addition, we can determine the repository associated with a `bitmap_index` struct. A `bitmap_index` points to either a `packed_git` or a `multi_pack_index`, both of which have direct repository references. To support this, we introduce a static helper function, `bitmap_repo`, in `pack-bitmap.c`, which retrieves a repository given a `bitmap_index`. With this, we clear up all usages of `the_repository` within `pack-bitmap.c` and also remove the `USE_THE_REPOSITORY_VARIABLE` definition. Bringing us another step closer to remove all global variable usage. Although this change also opens up the potential to clean up `midx.c`, doing so would require additional refactoring to pass the repository struct to functions where the MIDX struct is created: a task better suited for future patches. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions