From 2bcaa1499683372af7b8774024f0a503fb643fef Mon Sep 17 00:00:00 2001 From: Justin <4533867+Justin991q@users.noreply.github.com> Date: Fri, 25 Jan 2019 00:39:27 +0100 Subject: [PATCH] GitRepository: fixed getLastCommitId() on Windows Method getLastCommitId() returned NULL on Windows. --- src/GitRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GitRepository.php b/src/GitRepository.php index 435243d..cbc4322 100644 --- a/src/GitRepository.php +++ b/src/GitRepository.php @@ -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;