]> git.ipfire.org Git - thirdparty/git.git/commit
packfile: add repository to struct `packed_git`
authorKarthik Nayak <karthik.188@gmail.com>
Tue, 3 Dec 2024 14:43:55 +0000 (15:43 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 3 Dec 2024 23:21:53 +0000 (08:21 +0900)
commit2cf3fe63f6eedd6d132c530b897595345a05088b
tree0f595b48971febb4fc7f5240b26aada3dc448a51
parent8f8d6eee531b3fa1a8ef14f169b0cb5035f7a772
packfile: add repository to struct `packed_git`

The struct `packed_git` holds information regarding a packed object
file. Let's add the repository variable to this object, to represent the
repository that this packfile belongs to. This helps remove dependency
on the global `the_repository` object in `packfile.c` by simply using
repository information now readily available in the struct.

We do need to consider that a packfile could be part of the alternates
of a repository, but considering that we only have one repository struct
and also that we currently anyways use 'the_repository', we should be
OK with this change.

We also modify `alloc_packed_git` to ensure that the repository is added
to newly created `packed_git` structs. This requires modifying the
function and all its callee to pass the repository object down the
levels.

Helped-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fast-import.c
builtin/index-pack.c
commit-graph.c
connected.c
http.c
midx-write.c
midx.c
object-store-ll.h
packfile.c
packfile.h