Skip to content

Commit c0e8ab4

Browse files
committed
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 test fails due to this. Use "git symbolic-ref" instead to read the value of the symref. Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 67ad421 commit c0e8ab4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

contrib/subtree/t/t7900-subtree.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1597,7 +1597,8 @@ test_expect_success 'push split to subproj' '
15971597

15981598
test_expect_success 'subtree descendant check' '
15991599
subtree_test_create_repo "$test_count" &&
1600-
defaultBranch=$(sed "s,ref: refs/heads/,," "$test_count/.git/HEAD") &&
1600+
1601+
defaultBranch=$(git -C "$test_count" symbolic-ref --short HEAD) &&
16011602
test_create_commit "$test_count" folder_subtree/a &&
16021603
(
16031604
cd "$test_count" &&

0 commit comments

Comments
 (0)