diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-09-12 13:29:30 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-09-12 19:15:39 +0200 |
commit | a3673f48986cf990006e56a57e4ad3c7134161e7 (patch) | |
tree | e851e1882c9ab652b45e416dc2b4196ed0f09ac0 /prune-packed.c | |
parent | environment: make `get_git_common_dir()` accept a repository (diff) | |
download | git-a3673f48986cf990006e56a57e4ad3c7134161e7.tar.xz git-a3673f48986cf990006e56a57e4ad3c7134161e7.zip |
environment: make `get_object_directory()` accept a repository
The `get_object_directory()` function retrieves the path to the object
directory for `the_repository`. Make it accept a `struct repository`
such that it can work on arbitrary repositories and make it part of the
repository subsystem. This reduces our reliance on `the_repository` and
clarifies scope.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'prune-packed.c')
-rw-r--r-- | prune-packed.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/prune-packed.c b/prune-packed.c index e54daf740a..2bb99c29df 100644 --- a/prune-packed.c +++ b/prune-packed.c @@ -1,10 +1,12 @@ +#define USE_THE_REPOSITORY_VARIABLE + #include "git-compat-util.h" -#include "environment.h" #include "gettext.h" #include "object-store-ll.h" #include "packfile.h" #include "progress.h" #include "prune-packed.h" +#include "repository.h" static struct progress *progress; @@ -37,7 +39,7 @@ void prune_packed_objects(int opts) if (opts & PRUNE_PACKED_VERBOSE) progress = start_delayed_progress(_("Removing duplicate objects"), 256); - for_each_loose_file_in_objdir(get_object_directory(), + for_each_loose_file_in_objdir(repo_get_object_directory(the_repository), prune_object, NULL, prune_subdir, &opts); /* Ensure we show 100% before finishing progress */ |