Reorganize refs optimization tests to properly handle backend-specific vs backend-agnostic tests
Context
Currently, t/t1463-refs-optimize.sh enforces the files ref format for all tests using:
GIT_TEST_DEFAULT_REF_FORMAT=files
export GIT_TEST_DEFAULT_REF_FORMAT
This test file sources pack-refs-tests.sh, which is also used by t/t0601-reffiles-pack-refs.sh.
Problem
- The
refs optimizecommand isn't backend-specific, butt1463currently enforces the files format - The naming doesn't reflect that the test is backend-specific
- Adding reftable-specific tests to the current structure is awkward
- The shared test file
pack-refs-tests.shhas confusing naming given its usage
Proposed Solution
Two potential approaches discussed:
Option 1: Keep t1463 backend-agnostic
- Remove
GIT_TEST_DEFAULT_REF_FORMAT=filesfromt1463 - Add
REFFILESprerequisite to existing tests inpack-refs-tests.sh - Add reftable-specific tests using
git init --ref-format=reftable
Option 2: Move to t06* range and create separate test files
- Move
t1463to thet06*range (backend-specific tests) - Introduce a separate reftable-specific test file for refs optimization
- Create a new backend-generic test suite if needed
Recommendation
Option 2 is preferred as it:
- Properly reflects that current tests are backend-specific through naming/location
- Keeps backend-specific tests in the
t06*range where they belong - Allows for cleaner separation between reffiles and reftable tests
Related Files
t/t1463-refs-optimize.sht/t0601-reffiles-pack-refs.sht/pack-refs-tests.sh
Discussion from Slack thread
Edited by Karthik Nayak