From fb4d886c18eb50ff60f85bd88961ab98365e2a3a Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Tue, 26 Apr 2016 23:49:24 -0500 Subject: [PATCH] Issue 112 - small fix for files with spaces --- indefero/src/IDF/Scm/Git.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indefero/src/IDF/Scm/Git.php b/indefero/src/IDF/Scm/Git.php index f5b48bc..3aa2bdb 100644 --- a/indefero/src/IDF/Scm/Git.php +++ b/indefero/src/IDF/Scm/Git.php @@ -786,9 +786,9 @@ class IDF_Scm_Git extends IDF_Scm $rawlog = implode("\n", array_reverse($rawlog)); foreach(explode("\n", $rawlog) as $line) { if ($line[0] == ":") { - $matches = preg_split('/\s/', $line); - $currentFileHash = $matches[3]; - $file = $matches[5]; + preg_match('/\:([0-9]{6}) ([0-9]{6}) ([0-9a-z]{40}) ([0-9a-z]{40}) ([A-Z]{1})\s(.*)$/', $line, $matches); + $currentFileHash = $matches[4]; + $file = $matches[6]; $fileinfoarr[] = [ "filehash" => $currentFileHash, "file" => $file