Skip to content

Commit b829fd3

Browse files
committed
fix: set initial branch to main in branch-cleanup tests
The test was failing on CI because git's default branch name may not be 'main'. Using --initial-branch main ensures consistent behavior.
1 parent 0753b66 commit b829fd3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/commands/fix/branch-cleanup.integration.test.mts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ describe('branch-cleanup integration tests', () => {
3737
remoteDir = path.join(tempDir, 'remote.git')
3838
repoDir = path.join(tempDir, 'repo')
3939

40-
// Initialize bare remote repository.
40+
// Initialize bare remote repository with main as default branch.
4141
await fs.mkdir(remoteDir, { recursive: true })
42-
await spawn('git', ['init', '--bare'], { cwd: remoteDir, stdio: 'ignore' })
42+
await spawn('git', ['init', '--bare', '--initial-branch', 'main'], {
43+
cwd: remoteDir,
44+
stdio: 'ignore',
45+
})
4346

4447
// Clone the remote to create local repository.
4548
await spawn('git', ['clone', remoteDir, repoDir], {

0 commit comments

Comments
 (0)