Thread (139 messages) 139 messages, 5 authors, 2021-04-30

Re: [PATCH v3 02/30] subtree: t7900: update for having the default branch name be 'main'

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-04-30 09:43:24

On Tue, Apr 27 2021, Luke Shumaker wrote:
From: Luke Shumaker <redacted>

Most of the tests had been converted to support
`GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`, but `contrib/subtree/t/`
hadn't.

Convert it.  Most of the mentions of 'master' can just be replaced with
'HEAD'.
Looks good to me. FWIW (without having looked carefully) I'd have
probably just set up a "sub-proj" remote and done a "git fetch" after
configuring a refspec during the setup, but just s/master/HEAD/ is the
smaller change to just fix the "bug".
quoted hunk ↗ jump to hunk
[...]
@@ -994,6 +994,7 @@ test_expect_success 'push split to subproj' '
 next_test
 test_expect_success 'subtree descendant check' '
 	subtree_test_create_repo "$subtree_test_count" &&
+	defaultBranch=$(sed "s,ref: refs/heads/,," "$subtree_test_count/.git/HEAD") &&
 	test_create_commit "$subtree_test_count" folder_subtree/a &&
 	(
 		cd "$subtree_test_count" &&
This though needlessly peeks into the raw refstore. Use branch=$(git
symbolic-ref --short HEAD) instead. See e.g. my
https://lore.kernel.org/git/patch-08.11-7fb8849ce66-20210423T072006Z-avarab@gmail.com/ (local)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help