From 3d405d2b3f0fc7a0636d9e430464b16af6e53e2e Mon Sep 17 00:00:00 2001 From: Marcos Coelho Date: Wed, 19 Dec 2012 23:21:07 -0200 Subject: [PATCH] little change in the pattern to get match results correctly --- src/GitList/Git/Repository.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/GitList/Git/Repository.php b/src/GitList/Git/Repository.php index 4c0cf91..c4c3f1c 100644 --- a/src/GitList/Git/Repository.php +++ b/src/GitList/Git/Repository.php @@ -65,11 +65,13 @@ class Repository extends BaseRepository continue; } - preg_match_all('/([\w-._]+):(.+):([0-9]+):(.+)/', $result, $matches, PREG_SET_ORDER); + preg_match_all('/([\w-._]+):([^:]+):([0-9]+):(.+)/', $result, $matches, PREG_SET_ORDER); + $data['branch'] = $matches[0][1]; - $data['file'] = $matches[0][2]; - $data['line'] = $matches[0][3]; - $data['match'] = $matches[0][4]; + $data['file'] = $matches[0][2]; + $data['line'] = $matches[0][3]; + $data['match'] = $matches[0][4]; + $searchResults[] = $data; }