Re* [RFH] adding test coverage for contrib/ in CI jobs
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 3, 2026, 17:06 UTC
- Message-ID
- <xmqqjywtu58j.fsf_-_@gitster.g>
- In-Reply-To
- <xmqqsebhu9nn.fsf_-_@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 13 quoted lines
> Unfortunately, this seems to reveal existing other problems with > subtree tests (t7900), in addition to diff-highlight tests (t9400) > in various configurations. > > https://github.com/git/git/actions/runs/21617099884 > > This Ci run is near the tip of 'seen', so there may be breakages > attributable to new topics in flight, but I suspect that many of > them are already in 'master', noticed by nobody because nobody ran > these tests in these configurations (like "breaking changes", > "sha256", "leaks", "reftable", "asan"). > > I didn't look into the details of any of these (yet).
I didn't look into CI failures but spotted an easy one by eyeballing. As we seem to be lacking a dedicated subsystem maintainer for this tool, I am CCing those who have touched this test file during the past 24 months, plus our resident reftable expert.
----- >8 ----- Subject: subtree: allow testing with reftable backend
"git subtree" (in contrib/) comes with its own test script, which has this line
defaultBranch=$(sed "s,ref: refs/heads/,," "$test_count/.git/HEAD")
that assumes that you can read from .git/HEAD as a regular text file and you'd find a textual symref in reffiles backend.
Not necessarily.
make && cd contrib/subtree &&
GIT_TEST_DEFAULT_REF_FORMAT=reftable make testfails due to this. Use "git symbolic-ref" instead to read the value of the symref.
Signed-off-by: Junio C Hamano <gitster@pobox.com> --- contrib/subtree/t/t7900-subtree.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git c/contrib/subtree/t/t7900-subtree.sh w/contrib/subtree/t/t7900-subtree.sh index 316dc5269e..344956e72e 100755 --- c/contrib/subtree/t/t7900-subtree.sh +++ w/contrib/subtree/t/t7900-subtree.sh @@ -1597,7 +1597,8 @@ test_expect_success 'push split to subproj' ' test_expect_success 'subtree descendant check' ' subtree_test_create_repo "$test_count" && - defaultBranch=$(sed "s,ref: refs/heads/,," "$test_count/.git/HEAD") && + + defaultBranch=$(git -C "$test_count" symbolic-ref --short HEAD) && test_create_commit "$test_count" folder_subtree/a && ( cd "$test_count" &&