Re: [PATCH] [RFC][GSoC][PATCH] attr: use local repository state in read_attr
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 7, 2026, 21:41 UTC
- Message-ID
- <xmqqbji0b5ak.fsf@gitster.g>
- In-Reply-To
- <E605A7F6-AF4D-463F-8316-6BE69AFE0369@gmail.com>
Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:
Show 5 quoted lines
>> 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.