diff --git a/composer.json b/composer.json index 7a319827..957e68eb 100644 --- a/composer.json +++ b/composer.json @@ -93,7 +93,6 @@ "test:inline": "php bin/pest --configuration=phpunit.inline.xml", "test:parallel": "php bin/pest --exclude-group=integration --parallel --processes=3", "test:integration": "php bin/pest --group=integration -v", - "test:tia": "php bin/pest --configuration=tests-tia/phpunit.xml", "update:snapshots": "REBUILD_SNAPSHOTS=true php bin/pest --update-snapshots", "test": [ "@test:lint", diff --git a/src/Plugins/Tia.php b/src/Plugins/Tia.php index 70453cd4..4c92911a 100644 --- a/src/Plugins/Tia.php +++ b/src/Plugins/Tia.php @@ -657,8 +657,7 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable $changedFiles = new ChangedFiles($projectRoot); $branchSha = $graph->recordedAtSha($this->branch); - if ($changedFiles->gitAvailable() - && $branchSha !== null + if ($branchSha !== null && $changedFiles->since($branchSha) === null) { $this->renderBadge('WARN', 'Recorded commit is no longer reachable — graph will be rebuilt.'); $graph = null; @@ -812,12 +811,6 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable { $changedFiles = new ChangedFiles($projectRoot); - if (! $changedFiles->gitAvailable()) { - $this->renderBadge('WARN', 'Git unavailable — running full suite.'); - - return $arguments; - } - $branchSha = $graph->recordedAtSha($this->branch); $changed = $changedFiles->since($branchSha) ?? []; diff --git a/src/Plugins/Tia/ChangedFiles.php b/src/Plugins/Tia/ChangedFiles.php index 6afa258a..64b2fa6a 100644 --- a/src/Plugins/Tia/ChangedFiles.php +++ b/src/Plugins/Tia/ChangedFiles.php @@ -100,10 +100,6 @@ final readonly class ChangedFiles */ public function since(?string $sha): ?array { - if (! $this->gitAvailable()) { - return null; - } - $files = []; if ($sha !== null && $sha !== '') { @@ -215,10 +211,6 @@ final readonly class ChangedFiles public function currentBranch(): ?string { - if (! $this->gitAvailable()) { - return null; - } - $process = new Process(['git', 'rev-parse', '--abbrev-ref', 'HEAD'], $this->projectRoot); $process->run(); @@ -231,14 +223,6 @@ final readonly class ChangedFiles return $branch === '' || $branch === 'HEAD' ? null : $branch; } - public function gitAvailable(): bool - { - $process = new Process(['git', 'rev-parse', '--git-dir'], $this->projectRoot); - $process->run(); - - return $process->isSuccessful(); - } - private function shaIsReachable(string $sha): bool { $process = new Process( @@ -322,10 +306,6 @@ final readonly class ChangedFiles public function currentSha(): ?string { - if (! $this->gitAvailable()) { - return null; - } - $process = new Process(['git', 'rev-parse', 'HEAD'], $this->projectRoot); $process->run();