git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 5/5] t: allow testing with a non-default object storage foramt

From
Patrick Steinhardt <ps@pks.im>
Date
Nov 5, 2026, 15:02 UTC
Message-ID
<20261105-pks-storage-format-improvements-v1-5-870bb4212518@pks.im>
In-Reply-To
<20261105-pks-storage-format-improvements-v1-0-870bb4212518@pks.im>

It is already possible to test Git with a non-default ref storage format by specifying `GIT_TEST_DEFAULT_REF_STORAGE_FORMAT`. We don't provide the same mechanism yet for testing the object storage format, and will instead use the default ("files"). Even worse though, we may inherit whatever the user has configured in `GIT_DEFAULT_OBJECT_STORAGE_FORMAT`.

Introduce `GIT_TEST_DEFAULT_OBJECT_STORAGE_FORMAT` and have it default to the "files" backend.

Note that this environment variable isn't all that useful, as we do not have an alternative backend. But what it does allow is to figure out which tests will definitely break once we do have an alternative backend because they assume that objects exist in ".git/objects", as we can now move objects into a different location by specifying a payload.

Sure enough, running with "files://objdir" shows that around 1105 or our tests are failing. This is a surprisingly small number of failures, but we'll have to fix them if we ever want to introduce an alternative backend.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 t/test-lib.sh | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a893963f86c..7fdd8272162 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -576,9 +576,13 @@ export EDITOR
 GIT_TEST_BUILTIN_HASH=$("$GIT_BINARY" version --build-options | sed -ne 's/^default-hash: //p')
 GIT_DEFAULT_HASH="${GIT_TEST_DEFAULT_HASH:-$GIT_TEST_BUILTIN_HASH}"
 export GIT_DEFAULT_HASH
+
 GIT_DEFAULT_REF_STORAGE_FORMAT="${GIT_TEST_DEFAULT_REF_STORAGE_FORMAT:-files}"
 export GIT_DEFAULT_REF_STORAGE_FORMAT
 
+GIT_DEFAULT_OBJECT_STORAGE_FORMAT="${GIT_TEST_DEFAULT_OBJECT_STORAGE_FORMAT:-files}"
+export GIT_DEFAULT_OBJECT_STORAGE_FORMAT
+
 # Tests using GIT_TRACE typically don't want <timestamp> <file>:<line> output
 GIT_TRACE_BARE=1
 export GIT_TRACE_BARE
-- 
2.56.0.500.g5d06dc02cd.dirty
Previous: Karthik NayakNext: Junio C Hamano
Message 9 of 13 in “Improvements for storage format handling”
  1. 0/5 Improvements for storage format handlingPatrick Steinhardt, Nov 5, 2026
  2. 1/5 refs: create leading directoriesPatrick Steinhardt, Nov 5, 2026
  3. Karthik NayakNov 6, 2026
  4. Patrick SteinhardtNov 6, 2026
  5. 2/5 odb/files: create leading directoriesPatrick Steinhardt, Nov 5, 2026
  6. 3/5 setup: allow speciyfing payloads with default storage formatsPatrick Steinhardt, Nov 5, 2026
  7. 4/5 builtin/rev-parse: print payload for the ref storage formatPatrick Steinhardt, Nov 5, 2026
  8. Karthik NayakNov 6, 2026
  9. 5/5 t: allow testing with a non-default object storage foramtPatrick Steinhardt, Nov 5, 2026
  10. Junio C HamanoNov 6, 2026
  11. Patrick SteinhardtNov 9, 2026
  12. Karthik NayakNov 6, 2026
  13. Patrick SteinhardtNov 6, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.