-
-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
When using GitLab CI, a couple of custom refs are created in the GIT repository by GitLab to prevent errors with force-pushes and such (as far as I know "refs/pipelines/" and "refs/merge-requests/").
The problem is that this library checks every ref type in the repository and throws a RuntimeException if it doesn't recognize one:
gitlib/src/Gitonomy/Git/ReferenceBag.php
Lines 352 to 376 in b4620be
foreach ($parser->references as $row) { | |
list($commitHash, $fullname) = $row; | |
if (preg_match('#^refs/(heads|remotes)/(.*)$#', $fullname)) { | |
if (preg_match('#.*HEAD$#', $fullname)) { | |
continue; | |
} | |
$reference = new Branch($this->repository, $fullname, $commitHash); | |
$this->references[$fullname] = $reference; | |
$this->branches[] = $reference; | |
} elseif (preg_match('#^refs/tags/(.*)$#', $fullname)) { | |
$reference = new Tag($this->repository, $fullname, $commitHash); | |
$this->references[$fullname] = $reference; | |
$this->tags[] = $reference; | |
} elseif ($fullname === 'refs/stash') { | |
$reference = new Stash($this->repository, $fullname, $commitHash); | |
$this->references[$fullname] = $reference; | |
} elseif (preg_match('#^refs/pull/(.*)$#', $fullname)) { | |
// Do nothing here | |
} elseif ($fullname === 'refs/notes/gtm-data') { | |
// Do nothing here | |
} else { | |
throw new RuntimeException(sprintf('Unable to parse "%s"', $fullname)); | |
} | |
} |
I can make a pull request to fix this, but wouldn't it be better to ignore any unknown reference instead of having to manually include each of them in this file?
alexandresalome
Metadata
Metadata
Assignees
Labels
No labels