Skip to content

Commit

Permalink
composer#11855 fix: for real fix bareRepository error
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztof-ciszewski committed May 9, 2024
1 parent eb60b0f commit 0d48657
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Composer/Util/ProcessExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ private function doExecute($command, ?string $cwd, bool $tty, &$output = null):

$env = null;

if ($cwd && is_int(stripos($cwd, 'git '))) {
$env = ['GIT_DIR' => $cwd . '/.git'];
$cmdContainsGit = is_array($command) ? in_array('git', $command, true) : is_int(stripos($command, 'git'));

if ($cwd !== null && $cmdContainsGit) {
$env = ['GIT_DIR' => $cwd];
}

if (is_string($command)) {
Expand Down

0 comments on commit 0d48657

Please sign in to comment.