Skip to content

Commit

Permalink
Add a windows specific null device
Browse files Browse the repository at this point in the history
  • Loading branch information
markwalet committed Nov 27, 2023
1 parent 3443f3b commit 2ad968d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Drivers/ExecGitDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ private function command(string $command, array $options = []): string
'--git-dir' => $this->folder,
]);

return "git $gitOptions $command $commandOptions 2>/dev/null";
$nullDevice = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? '/nul' : '/dev/null';

return "git $gitOptions $command $commandOptions 2>$nullDevice";
}

/**
Expand Down

0 comments on commit 2ad968d

Please sign in to comment.