Skip to content

Commit

Permalink
composer#11855 fix: use proper directory for GIT_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztof-ciszewski committed May 9, 2024
1 parent 0d48657 commit ecf80ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Composer/Util/ProcessExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ private function doExecute($command, ?string $cwd, bool $tty, &$output = null):

$cmdContainsGit = is_array($command) ? in_array('git', $command, true) : is_int(stripos($command, 'git'));

if ($cwd !== null && $cmdContainsGit) {
$dotGitDir = sprintf('%s/.git', trim((string) $cwd, '/'));
$hasGitDotDir = file_exists($dotGitDir);
if ($hasGitDotDir === false && $cmdContainsGit) {
$env = ['GIT_DIR' => $cwd];
}

Expand Down

0 comments on commit ecf80ed

Please sign in to comment.