diff --git a/src/PHPGit/Command/BranchCommand.php b/src/PHPGit/Command/BranchCommand.php index 4b42f50..6e0fbce 100644 --- a/src/PHPGit/Command/BranchCommand.php +++ b/src/PHPGit/Command/BranchCommand.php @@ -64,7 +64,7 @@ public function __invoke(array $options = array()) foreach ($lines as $line) { $branch = array(); - preg_match('/(?\*| ) (?[^\s]+) +((?:->) (?[^\s]+)|(?[0-9a-z]{7}) (?.*))/', $line, $matches); + preg_match('/(?<current>\*| ) (?<name>[^\s]+) +((?:->) (?<alias>[^\s]+)|(?<hash>[0-9a-z]{7,8}) (?<title>.*))/', $line, $matches); $branch['current'] = ($matches['current'] == '*'); $branch['name'] = $matches['name']; @@ -226,4 +226,4 @@ protected function getProcessBuilder() ->add('branch'); } -} \ No newline at end of file +}