Skip to content

Commit

Permalink
test: set default branch to main (peter-evans#1310)
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-evans authored and aleksandrychev committed Mar 4, 2024
1 parent 311ed52 commit b6a9732
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions __test__/create-or-update-branch.int.test.ts
Expand Up @@ -14,7 +14,7 @@ const REMOTE_NAME = 'origin'
const TRACKED_FILE = 'a/tracked-file.txt'
const UNTRACKED_FILE = 'b/untracked-file.txt'

const DEFAULT_BRANCH = 'tests/master'
const DEFAULT_BRANCH = 'tests/main'
const NOT_BASE_BRANCH = 'tests/branch-that-is-not-the-base'
const NOT_EXIST_BRANCH = 'tests/branch-that-does-not-exist'

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

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

// Create a new default branch for the test run with a tracked file
await git.checkout('master')
await git.checkout('main')
await git.checkout(DEFAULT_BRANCH, 'HEAD')
await createFile(TRACKED_FILE)
await git.exec(['add', '-A'])
Expand Down
1 change: 1 addition & 0 deletions __test__/entrypoint.sh
Expand Up @@ -6,6 +6,7 @@ WORKINGDIR=$PWD

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

Expand Down

0 comments on commit b6a9732

Please sign in to comment.