From: Pushkar Singh Date: Sun, 05 Apr 2026 06:03:07 GMT Subject: Re: [PATCH] object-file: don't use object database without a repository Message-ID: In-Reply-To: <20260404172817.2995133-1-luca.stefani.ge1@gmail.com> Hi Luca, Thanks for the patch, this was interesting to read. [snip] > When git diff is invoked without a backing repository, > INDEX_WRITE_OBJECT is never set in flags, meaning only the hash is > needed and nothing should be written to the object store. From my understanding, this avoids using the object database in non-repository scenarios by forcing the use of index_core() when INDEX_WRITE_OBJECT is not set, which makes sense since we only need the hash in that case. I had a small question regarding coverage: - Do we already have tests for cases like: git diff -- outside a repository, especially with large files triggering this path? It might be useful to add one to ensure this behavior is preserved. Also, are there any other callers of index_fd() that might rely on similar assumptions about repository initialization? Thanks, Pushkar