diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-03-10 08:13:21 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-03-10 13:16:18 -0700 |
| commit | 74d414c9f14a91a3b7bd04972bf3eb9bbe6fd81b (patch) | |
| tree | 7a267ede2a7630503346248db75be00cfd828f00 /object.h | |
| parent | csum-file: stop depending on `the_repository` (diff) | |
| download | git-74d414c9f14a91a3b7bd04972bf3eb9bbe6fd81b.tar.gz git-74d414c9f14a91a3b7bd04972bf3eb9bbe6fd81b.zip | |
object: stop depending on `the_repository`
There are a couple of functions exposed by "object.c" that implicitly
depend on `the_repository`. Remove this dependency by injecting the
repository via a parameter. Adapt callers accordingly by simply using
`the_repository`, except in cases where the subsystem is already free of
the repository. In that case, we instead pass the repository provided by
the caller's context.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object.h')
| -rw-r--r-- | object.h | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -169,12 +169,13 @@ int type_from_string_gently(const char *str, ssize_t, int gentle); /* * Return the current number of buckets in the object hashmap. */ -unsigned int get_max_object_index(void); +unsigned int get_max_object_index(const struct repository *repo); /* * Return the object from the specified bucket in the object hashmap. */ -struct object *get_indexed_object(unsigned int); +struct object *get_indexed_object(const struct repository *repo, + unsigned int); /* * This can be used to see if we have heard of the object before, but @@ -231,7 +232,8 @@ struct object *parse_object_with_flags(struct repository *r, * "name" parameter is not NULL, it is included in the error message * (otherwise, the hex object ID is given). */ -struct object *parse_object_or_die(const struct object_id *oid, const char *name); +struct object *parse_object_or_die(struct repository *repo, const struct object_id *oid, + const char *name); /* Given the result of read_sha1_file(), returns the object after * parsing it. eaten_p indicates if the object has a borrowed copy @@ -336,7 +338,7 @@ void object_array_remove_duplicates(struct object_array *array); */ void object_array_clear(struct object_array *array); -void clear_object_flags(unsigned flags); +void clear_object_flags(struct repository *repo, unsigned flags); /* * Clear the specified object flags from all in-core commit objects from |
