Skip to content

Commit f7fe85c

Browse files
committed
GitRepository: method run() is public now (#100)
1 parent a7eb77e commit f7fe85c

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/GitRepository.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,24 @@ public function execute(...$cmd)
570570
}
571571

572572

573+
/**
574+
* Runs command and returns result.
575+
* @param mixed ...$args
576+
* @return RunnerResult
577+
* @throws GitException
578+
*/
579+
public function run(...$args)
580+
{
581+
$result = $this->runner->run($this->repository, $args);
582+
583+
if (!$result->isOk()) {
584+
throw new GitException("Command '{$result->getCommand()}' failed (exit-code {$result->getExitCode()}).", $result->getExitCode(), NULL, $result);
585+
}
586+
587+
return $result;
588+
}
589+
590+
573591
/**
574592
* @param array<mixed> $args
575593
* @return string[]|NULL
@@ -602,22 +620,4 @@ protected function extractFromCommand(array $args, callable $filter = NULL)
602620

603621
return $output;
604622
}
605-
606-
607-
/**
608-
* Runs command.
609-
* @param mixed ...$args
610-
* @return RunnerResult
611-
* @throws GitException
612-
*/
613-
protected function run(...$args)
614-
{
615-
$result = $this->runner->run($this->repository, $args);
616-
617-
if (!$result->isOk()) {
618-
throw new GitException("Command '{$result->getCommand()}' failed (exit-code {$result->getExitCode()}).", $result->getExitCode(), NULL, $result);
619-
}
620-
621-
return $result;
622-
}
623623
}

0 commit comments

Comments
 (0)