Skip to content

Commit

Permalink
GitRepository: fixed getLastCommitId() on Windows
Browse files Browse the repository at this point in the history
Method getLastCommitId() returned NULL on Windows.
  • Loading branch information
Justin991q authored and janpecha committed Jan 25, 2019
1 parent 7e14616 commit 2bcaa14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/GitRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,14 +377,14 @@ public function commit($message, $params = NULL)

/**
* Returns last commit ID on current branch
* `git log --pretty=format:'%H' -n 1`
* `git log --pretty=format:"%H" -n 1`
* @return string|NULL
* @throws GitException
*/
public function getLastCommitId()
{
$this->begin();
$lastLine = exec('git log --pretty=format:\'%H\' -n 1 2>&1');
$lastLine = exec('git log --pretty=format:"%H" -n 1 2>&1');
$this->end();
if (preg_match('/^[0-9a-f]{40}$/i', $lastLine)) {
return $lastLine;
Expand Down

0 comments on commit 2bcaa14

Please sign in to comment.