git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t7817: do not depend on any specific default branch name
@ 2020-12-04 21:06 Johannes Schindelin via GitGitGadget
  0 siblings, 0 replies; only message in thread
From: Johannes Schindelin via GitGitGadget @ 2020-12-04 21:06 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

Elsewhere, we introduced support to override the default branch name in
the tests via `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME`. Therefore, we
should avoid expecting a particular hard-coded name in test scripts.

So let's rename the initial branch immediately to `main` and work with
that.

This avoids breakages in t7817 when the default branch name is changed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
    t7817: do not depend on any specific default branch name
    
    This should fix the CI build of seen with regard to t7817. The patch is
    designed to be applied on top of mt/grep-sparse-checkout.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-808%2Fdscho%2Ft7817-and-the-default-branch-name-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-808/dscho/t7817-and-the-default-branch-name-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/808

 t/t7817-grep-sparse-checkout.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/t/t7817-grep-sparse-checkout.sh b/t/t7817-grep-sparse-checkout.sh
index f93a4f71d1..d9d32c6435 100755
--- a/t/t7817-grep-sparse-checkout.sh
+++ b/t/t7817-grep-sparse-checkout.sh
@@ -77,7 +77,8 @@ test_expect_success 'setup' '
 	test_path_is_missing sub/A &&
 	test_path_is_file a &&
 	test_path_is_file sub/B/b &&
-	test_path_is_file sub2/a
+	test_path_is_file sub2/a &&
+	git branch -m main
 '
 
 # The two tests below check a special case: the sparsity patterns exclude '/b'
@@ -110,12 +111,12 @@ test_expect_success 'grep unmerged file despite not matching sparsity patterns'
 	b:modified-b-in-branchY
 	EOF
 	test_when_finished "test_might_fail git merge --abort && \
-			    git checkout master" &&
+			    git checkout main" &&
 
 	git sparse-checkout disable &&
-	git checkout -b branchY master &&
+	git checkout -b branchY main &&
 	test_commit modified-b-in-branchY b &&
-	git checkout -b branchX master &&
+	git checkout -b branchX main &&
 	test_commit modified-b-in-branchX b &&
 
 	git sparse-checkout init &&

base-commit: aaff72b8c3e3d95917f3432396073a7708b16a90
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-04 21:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-04 21:06 [PATCH] t7817: do not depend on any specific default branch name Johannes Schindelin via GitGitGadget

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).