This commit is contained in:
nuno maduro
2026-05-02 17:18:35 +01:00
parent 8a14056111
commit 1aa80dc398
3 changed files with 1 additions and 29 deletions

View File

@ -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();