Skip to content

Commit ee93d78

Browse files
authored
test: set default branch to main (peter-evans#1310)
1 parent 6c704eb commit ee93d78

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

__test__/create-or-update-branch.int.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const REMOTE_NAME = 'origin'
1414
const TRACKED_FILE = 'a/tracked-file.txt'
1515
const UNTRACKED_FILE = 'b/untracked-file.txt'
1616

17-
const DEFAULT_BRANCH = 'tests/master'
17+
const DEFAULT_BRANCH = 'tests/main'
1818
const NOT_BASE_BRANCH = 'tests/branch-that-is-not-the-base'
1919
const NOT_EXIST_BRANCH = 'tests/branch-that-does-not-exist'
2020

@@ -108,10 +108,10 @@ describe('create-or-update-branch tests', () => {
108108
// Check there are no local changes that might be destroyed by running these tests
109109
expect(await git.isDirty(true)).toBeFalsy()
110110
// Fetch the default branch
111-
await git.fetch(['master:refs/remotes/origin/master'])
111+
await git.fetch(['main:refs/remotes/origin/main'])
112112

113113
// Create a "not base branch" for the test run
114-
await git.checkout('master')
114+
await git.checkout('main')
115115
await git.checkout(NOT_BASE_BRANCH, 'HEAD')
116116
await createFile(TRACKED_FILE)
117117
await git.exec(['add', '-A'])
@@ -123,7 +123,7 @@ describe('create-or-update-branch tests', () => {
123123
])
124124

125125
// Create a new default branch for the test run with a tracked file
126-
await git.checkout('master')
126+
await git.checkout('main')
127127
await git.checkout(DEFAULT_BRANCH, 'HEAD')
128128
await createFile(TRACKED_FILE)
129129
await git.exec(['add', '-A'])

__test__/entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ WORKINGDIR=$PWD
66

77
# Create and serve a remote repo
88
mkdir -p /git/remote
9+
git config --global init.defaultBranch main
910
git init --bare /git/remote/test-base.git
1011
git daemon --verbose --enable=receive-pack --base-path=/git/remote --export-all /git/remote &>/dev/null &
1112

0 commit comments

Comments
 (0)