diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-04-29 09:52:19 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-04-29 10:08:13 -0700 |
| commit | f8fc4cacd37afa254a8822258f76de53ae2dfbb2 (patch) | |
| tree | 9af99cedd8587e19db6d968bb19ac996b8078456 /object-store.h | |
| parent | object-store: move function declarations to their respective subsystems (diff) | |
| download | git-f8fc4cacd37afa254a8822258f76de53ae2dfbb2.tar.gz git-f8fc4cacd37afa254a8822258f76de53ae2dfbb2.zip | |
object-store: allow fetching objects via `has_object()`
We're about to fully remove `repo_has_object_file()` in favor of
`has_object()`. The latter function does not yet have a way to fetch
missing objects via a promisor remote though, which means that it cannot
fully replace all usecases of `repo_has_object_file()`.
Introduce a new flag `HAS_OBJECT_FETCH_PROMISOR` that causes the
function to optionally fetch missing objects which are part of a
promisor pack. This flag will be used in the subsequent commit.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object-store.h')
| -rw-r--r-- | object-store.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/object-store.h b/object-store.h index 9dc39a7c91..f0e111464c 100644 --- a/object-store.h +++ b/object-store.h @@ -262,12 +262,16 @@ int oid_object_info_extended(struct repository *r, const struct object_id *, struct object_info *, unsigned flags); -/* Retry packed storage after checking packed and loose storage */ -#define HAS_OBJECT_RECHECK_PACKED 1 +enum { + /* Retry packed storage after checking packed and loose storage */ + HAS_OBJECT_RECHECK_PACKED = (1 << 0), + /* Allow fetching the object in case the repository has a promisor remote. */ + HAS_OBJECT_FETCH_PROMISOR = (1 << 1), +}; /* * Returns 1 if the object exists. This function will not lazily fetch objects - * in a partial clone. + * in a partial clone by default. */ int has_object(struct repository *r, const struct object_id *oid, unsigned flags); |
