Subject: Re: [PATCH] [RFC][GSoC][PATCH] attr: use local repository state in read_attr

From: Junio C Hamano <[email-masked]>
Date: Sat, 07 Feb 2026 13:41:07 -0800

Lucas Seiki Oshiro <[email-masked]> writes:

>> read_attr() currently relies on is_bare_repository(), which
>> implicitly depends on the global the_repository.
>
> So, wouldn't it be better to make is_bare_repository depend
> on a `struct repository *repo` instead of `the_repository`?

The codepath read_attr() is in is usually not that hot but it is not
cheap.

The repository object should have a boolean that says "I am bare",
perhaps initialized lazily, and your version of is_bare_repository
that takes a repository object would be a good entry point to it.

Also, IIRC, there is another releated effort to allow attribute data
source to become per repository.  This change may want to coordinate
with it.

Thanks.