Skip to content

Commit

Permalink
GitRepository: method run() is public now (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
janpecha committed Aug 5, 2024
1 parent a7eb77e commit f7fe85c
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/GitRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,24 @@ public function execute(...$cmd)
}


/**
* Runs command and returns result.
* @param mixed ...$args
* @return RunnerResult
* @throws GitException
*/
public function run(...$args)
{
$result = $this->runner->run($this->repository, $args);

if (!$result->isOk()) {
throw new GitException("Command '{$result->getCommand()}' failed (exit-code {$result->getExitCode()}).", $result->getExitCode(), NULL, $result);
}

return $result;
}


/**
* @param array<mixed> $args
* @return string[]|NULL
Expand Down Expand Up @@ -602,22 +620,4 @@ protected function extractFromCommand(array $args, callable $filter = NULL)

return $output;
}


/**
* Runs command.
* @param mixed ...$args
* @return RunnerResult
* @throws GitException
*/
protected function run(...$args)
{
$result = $this->runner->run($this->repository, $args);

if (!$result->isOk()) {
throw new GitException("Command '{$result->getCommand()}' failed (exit-code {$result->getExitCode()}).", $result->getExitCode(), NULL, $result);
}

return $result;
}
}

0 comments on commit f7fe85c

Please sign in to comment.