From 06f65ca8e2694a5ff832e77dc80b22d5249dd8fc Mon Sep 17 00:00:00 2001 From: Vitaliy Ognev Date: Sun, 23 Dec 2012 14:32:32 +0200 Subject: [PATCH] should take 1st match --- src/GitList/Util/Repository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitList/Util/Repository.php b/src/GitList/Util/Repository.php index 16c1b33..0236d14 100644 --- a/src/GitList/Util/Repository.php +++ b/src/GitList/Util/Repository.php @@ -207,7 +207,7 @@ class Repository // No exact ref match, so just try our best if (count($valid_refs) > 1) { preg_match('/([^\/]+)(.*)/', $input, $matches); - $branch = preg_replace('/^\/|\/$/', '', $matches[0]); + $branch = preg_replace('/^\/|\/$/', '', $matches[1]); } else { // Extract branch name $branch = array_shift($valid_refs);