From: Karthik Nayak Date: Mon, 19 Oct 2026 21:34:39 GMT Subject: Re: [PATCH 3/7] setup: allow overriding object storage format via environment Message-ID: In-Reply-To: <20261019-b4-pks-odb-extension-v1-3-143a5963b77f@pks.im> Patrick Steinhardt writes: > The ref storage format configured via "extensions.refStorage" can be > overridden with the GIT_REF_STORAGE_FORMAT environment variable. > Introduce the GIT_OBJECT_STORAGE_FORMAT environment variable that > overrides "extensions.objectStorage" in the same way. [snip] > diff --git a/t/t0001-init.sh b/t/t0001-init.sh > index c7c464d3a2..5e7c25e42c 100755 > --- a/t/t0001-init.sh > +++ b/t/t0001-init.sh > @@ -869,6 +869,32 @@ test_expect_success DEFAULT_REPO_FORMAT 'extensions.objectStorage with unknown b > test_grep "invalid value for ${SQ}extensions.objectstorage${SQ}: ${SQ}garbage://payload${SQ}" err > ' > > +test_expect_success DEFAULT_REPO_FORMAT 'GIT_OBJECT_STORAGE_FORMAT overrides extensions.objectStorage' ' > + test_when_finished "rm -rf objstorage" && > + git init objstorage && > + ( > + cd objstorage && > + git config set core.repositoryformatversion 1 && > + git config set extensions.objectStorage files://objs && This commit does test the payload for the files backend. I do wonder if we can make a matrix for tests {config, env} x {valid backend, invalid backend} x {valid relative path, valid absolute path, invalid path} > + mkdir .git/objs .git/other && > + > + echo content >file && > + oid=$(git hash-object -w file) && > + test_path_is_file .git/objs/$(test_oid_to_path "$oid") && > + git cat-file -e "$oid" && > + > + test_must_fail env GIT_OBJECT_STORAGE_FORMAT=files://other git cat-file -e "$oid" && > + GIT_OBJECT_STORAGE_FORMAT=files://other git hash-object -w file && > + test_path_is_file .git/other/$(test_oid_to_path "$oid") && > + > + cat >expect <<-EOF && > + fatal: unknown object storage format: ${SQ}garbage${SQ} > + EOF > + test_must_fail env GIT_OBJECT_STORAGE_FORMAT=garbage git rev-parse 2>err && > + test_cmp expect err > + ) > +' > + > test_expect_success MINGW 'core.hidedotfiles = false' ' > git config --global core.hidedotfiles false && > rm -rf newdir && > > -- > 2.56.0.269.g68944adf51.dirty