Skip to content

Commit

Permalink
Add ability to specify a git path (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
acharron-hl authored Nov 21, 2024
1 parent 0b6cb3c commit d36ee8c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ class Repository {
* Constructor.
*
* @param string $dir
* @param string|null $gitPath
*
* @throws GitException If the repository does not exist.
*/
public function __construct(string $dir) {
public function __construct(string $dir, ?string $gitPath = null) {
$executableFinder = new ExecutableFinder();
$gitPath = $executableFinder->find('git');
$gitPath = $gitPath ?? $executableFinder->find('git');
if ($gitPath === null) {
// Since CI always has git installed we don't really have a way to test this.
// @codeCoverageIgnoreStart
Expand Down

0 comments on commit d36ee8c

Please sign in to comment.