mirror of
https://github.com/composer/composer
synced 2025-05-09 08:32:56 +00:00
Minor robustness fix
This commit is contained in:
parent
5edb49c067
commit
3aeb6a8f2d
1 changed files with 3 additions and 2 deletions
|
@ -165,8 +165,9 @@ class GitDriver extends VcsDriver
|
|||
$this->process->execute('git branch --no-color --no-abbrev -v', $output, $this->repoDir);
|
||||
foreach ($this->process->splitLines($output) as $branch) {
|
||||
if ($branch && !preg_match('{^ *[^/]+/HEAD }', $branch)) {
|
||||
preg_match('{^(?:\* )? *(?:[^/ ]+?/)?(\S+) *([a-f0-9]+) .*$}', $branch, $match);
|
||||
$branches[$match[1]] = $match[2];
|
||||
if (preg_match('{^(?:\* )? *(?:[^/ ]+?/)?(\S+) *([a-f0-9]+) .*$}', $branch, $match)) {
|
||||
$branches[$match[1]] = $match[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue