diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-07-17 06:56:39 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-16 22:16:17 -0700 |
| commit | d81712ce65f7ee59ce88c8b74f09b6e6456a6f3c (patch) | |
| tree | c4489f5d836c944447042afe0b1c364b4bb81c4a /builtin/cat-file.c | |
| parent | object-file: remove declaration for `for_each_file_in_obj_subdir()` (diff) | |
| download | git-d81712ce65f7ee59ce88c8b74f09b6e6456a6f3c.tar.gz git-d81712ce65f7ee59ce88c8b74f09b6e6456a6f3c.zip | |
object-file: get rid of `the_repository` in loose object iterators
The iterators for loose objects still rely on `the_repository`. Refactor
them:
- `for_each_loose_file_in_objdir()` is refactored so that the caller
is now expected to pass an `odb_source` as parameter instead of the
path to that source. Furthermore, it is renamed accordingly to
`for_each_loose_file_in_source()`.
- `for_each_loose_object()` is refactored to take in an object
database now and calls the above function in a loop.
This allows us to get rid of the global dependency.
Adjust callers accordingly.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/cat-file.c')
| -rw-r--r-- | builtin/cat-file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 2492a0b6f3..aa1498aa60 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -848,7 +848,7 @@ static void batch_each_object(struct batch_options *opt, }; struct bitmap_index *bitmap = prepare_bitmap_git(the_repository); - for_each_loose_object(batch_one_object_loose, &payload, 0); + for_each_loose_object(the_repository->objects, batch_one_object_loose, &payload, 0); if (bitmap && !for_each_bitmapped_object(bitmap, &opt->objects_filter, batch_one_object_bitmapped, &payload)) { |
