Skip to content

Commit f2bdfb4

Browse files
Fix git test branch naming issue
- Ensure 'main' branch exists after init using 'git branch -M main' - Fixes test failures on systems where default branch is not 'main' Co-authored-by: Manuel Kießling <manuel@kiessling.net>
1 parent a7fdbf5 commit f2bdfb4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/Unit/WorkspaceMgmt/GitCliAdapterTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ protected function setUp(): void
3636
$this->runGitCommand('add .');
3737
$this->runGitCommand('commit -m "First commit"');
3838

39+
// Ensure we're on a branch called 'main' (git init might create 'master' or no default branch)
40+
$this->runGitCommand('branch -M main');
41+
3942
file_put_contents($this->testRepoPath . '/file2.txt', 'Content 2');
4043
$this->runGitCommand('add .');
4144
$this->runGitCommand('commit -m "Second commit" -m "This is the body of the second commit"');

0 commit comments

Comments
 (0)