Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: set default branch to main #1310

Merged
merged 1 commit into from Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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