Skip to content

Commit

Permalink
Fix executing git commands
Browse files Browse the repository at this point in the history
  • Loading branch information
mitelg committed Feb 6, 2023
1 parent 364c29d commit 4528f75
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 41 deletions.
76 changes: 38 additions & 38 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/DirectoryFilterIterator.php
Expand Up @@ -13,7 +13,7 @@ class DirectoryFilterIterator extends \FilterIterator
/**
* {@inheritdoc}
*/
public function accept()
public function accept(): bool
{
return $this->isValidDir($this->current());
}
Expand Down
5 changes: 3 additions & 2 deletions src/Services/GitUtil.php
Expand Up @@ -47,9 +47,10 @@ public function __construct(OutputInterface $output, GitIdentityEnvironment $git
*/
public function run($commandline, $timeout = null): string
{
$commandline = 'git ' . $commandline;
$command = array_filter(explode(' ', $commandline));
array_unshift($command, 'git');

$process = new Process($commandline, null, $this->gitEnv->getGitEnv());
$process = new Process($command, null, $this->gitEnv->getGitEnv());
$process->setTimeout($timeout ?: $this->timeout);

$output = $this->output; // tmp var needed for php < 5.4
Expand Down

0 comments on commit 4528f75

Please sign in to comment.