Re: [PATCH 09/13] refs: don't fetch promisor objects in `ref_resolves_to_object()`
Patrick Steinhardt <ps@pks.im> writes:
> Similar to the preceding commit, don't try to fetch objects pointed to
> by references. Any reference whose object does not exist is broken by
> definition an, so we should report it accordingly.
>
Show 21 quoted lines
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> refs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/refs.c b/refs.c
> index 6559db37890..0492cf0d13a 100644
> --- a/refs.c
> +++ b/refs.c
> @@ -376,7 +376,7 @@ int ref_resolves_to_object(const char *refname,
> {
> if (flags & REF_ISBROKEN)
> return 0;
> - if (!repo_has_object_file(repo, oid)) {
> + if (!has_object(repo, oid, HAS_OBJECT_RECHECK_PACKED)) {
> error(_("%s does not point to a valid object!"), refname);
> return 0;
> }
>
> --
> 2.49.0.901.g37484f566f.dirty