This commit is contained in:
nuno maduro
2026-08-05 20:20:35 +01:00
parent d112582857
commit e90e4f70fc
8 changed files with 360 additions and 16 deletions
+11
View File
@@ -96,6 +96,17 @@ final readonly class GitRepo
$this->run(['symbolic-ref', 'refs/remotes/origin/HEAD', 'refs/remotes/origin/'.$branch]);
}
/**
* Drops `refs/remotes/origin/HEAD` while keeping the remote-tracking branch
* — what a CI checkout looks like. `actions/checkout` builds its working
* copy with `git init` plus a single-ref `fetch` rather than a `clone`, and
* only a `clone` writes that symbolic ref.
*/
public function unsetOriginHead(): void
{
$this->run(['symbolic-ref', '--delete', 'refs/remotes/origin/HEAD']);
}
public function config(string $key, string $value): void
{
$this->run(['config', '--local', $key, $value]);
+7
View File
@@ -222,6 +222,13 @@ final class Project
'PARATEST' => '0',
'PAO_DISABLE' => '1',
'HOME' => $this->home(),
// Blanked for the same reason `GitRepo::ENV` blanks git's own
// config: the default branch a CI provider reports is the one
// *its* build is for. Pest's suite runs on GitHub Actions, so
// without this every scenario would autodetect Pest's default
// branch instead of the fixture's.
'GITHUB_EVENT_PATH' => '',
'CI_DEFAULT_BRANCH' => '',
...$environment,
],
);