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

Re* [RFH] adding test coverage for contrib/ in CI jobs

From
CSColin Stagner <ask+git@howdoi.land>
Date
Feb 4, 2026, 04:38 UTC
Message-ID
<20260204043812.814884-3-ask+git@howdoi.land>
In-Reply-To
<xmqqjywtu58j.fsf_-_@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
> I didn't look into CI failures but spotted an easy one by
> eyeballing.
[snip]
Show 9 quoted lines
>--- 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) &&

The subtree tests set GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME, so this is one alternative.

I'll see what I can do about any remaining failures. I'd like to improve the test coverage for subtree split. split has a lot of complicated logic that needs to be preserved across updates.

-- >8 --
Subject: contrib/subtree: fix tests with reftable backend

One git-subtree test-case relies on git internals to infer the default branch name. This test fails with the new reftable backend.

    GIT_TEST_DEFAULT_REF_FORMAT=reftable \
      meson test t7900-subtree
This test script already sets
    GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main

which eliminates the need to infer a branch name at runtime. Hardcode the branch name.

Signed-off-by: Colin Stagner <ask+git@howdoi.land>
---
 contrib/subtree/t/t7900-subtree.sh | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh
index 316dc5269e..e7040718f2 100755
--- a/contrib/subtree/t/t7900-subtree.sh
+++ b/contrib/subtree/t/t7900-subtree.sh
@@ -1597,7 +1597,6 @@ 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") &&
 	test_create_commit "$test_count" folder_subtree/a &&
 	(
 		cd "$test_count" &&
@@ -1614,7 +1613,7 @@ test_expect_success 'subtree descendant check' '
 	(
 		cd "$test_count" &&
 		git cherry-pick $cherry &&
-		git checkout $defaultBranch &&
+		git checkout main &&
 		git merge -m "merge should be kept on subtree" branch &&
 		git branch no_subtree_work_branch
 	) &&
@@ -1626,10 +1625,10 @@ test_expect_success 'subtree descendant check' '
 	test_create_commit "$test_count" not_a_subtree_change &&
 	(
 		cd "$test_count" &&
-		git checkout $defaultBranch &&
+		git checkout main &&
 		git merge -m "merge should be skipped on subtree" no_subtree_work_branch &&
 
-		git subtree split --prefix folder_subtree/ --branch subtree_tip $defaultBranch &&
+		git subtree split --prefix folder_subtree/ --branch subtree_tip main &&
 		git subtree split --prefix folder_subtree/ --branch subtree_branch branch &&
 		test $(git rev-list --count subtree_tip..subtree_branch) = 0
 	)
-- 
2.43.0
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 19 in “subtree: validate --prefix against commit in split”
  1. subtree: validate --prefix against commit in splitPushkar Singh, Jan 15, 2026
  2. subtree: validate --prefix against commit in splitPushkar Singh, Jan 15, 2026
  3. Junio C HamanoJan 15, 2026
  4. subtree: validate --prefix against commit in splitPushkar Singh, Jan 15, 2026
  5. Josh SteadmonFeb 2, 2026
  6. Junio C HamanoFeb 2, 2026
  7. Junio C HamanoFeb 2, 2026
  8. [RFH] adding test coverage for contrib/ in CI jobsJunio C Hamano, Feb 3, 2026
  9. Re* [RFH] adding test coverage for contrib/ in CI jobsJunio C Hamano, Feb 3, 2026
  10. Junio C HamanoFeb 3, 2026
  11. Re* [RFH] adding test coverage for contrib/ in CI jobsColin Stagner, Feb 4, 2026
  12. Junio C HamanoFeb 4, 2026
  13. Colin StagnerFeb 5, 2026
  14. Junio C HamanoFeb 5, 2026
  15. Junio C HamanoFeb 5, 2026
  16. Junio C HamanoFeb 3, 2026
  17. Jeff KingFeb 3, 2026
  18. subtree: validate --prefix against commit in splitPushkar Singh, Feb 3, 2026
  19. Junio C HamanoFeb 3, 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.