mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 10:12:41 +01:00
Don't throw an exception if the author of a tag can't be found
Summary: It's possible to have a tag with no tagger (or git used to allow this), so some tags (like 26791a8bcf0e6d33f43aef7682bdb555236d56de in the linux kernel) were causing trouble. Test Plan: opened diffusion to a page where I was previously getting a red box complaining about being unable to parse the output of git for-each-ref. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin, vrana Differential Revision: https://secure.phabricator.com/D2711
This commit is contained in:
parent
a0b57cefb7
commit
865680ad30
1 changed files with 6 additions and 5 deletions
|
@ -49,12 +49,13 @@ final class DiffusionGitTagListQuery extends DiffusionTagListQuery {
|
||||||
|
|
||||||
$matches = null;
|
$matches = null;
|
||||||
if (!preg_match('/^(.*) ([0-9]+) ([0-9+-]+)$/', $creator, $matches)) {
|
if (!preg_match('/^(.*) ([0-9]+) ([0-9+-]+)$/', $creator, $matches)) {
|
||||||
throw new Exception(
|
// It's possible a tag doesn't have a creator (tagger)
|
||||||
"Unparseable output from 'git for-each-ref': {$line}");
|
$author = null;
|
||||||
}
|
$epoch = null;
|
||||||
|
} else {
|
||||||
$author = $matches[1];
|
$author = $matches[1];
|
||||||
$epoch = $matches[2];
|
$epoch = $matches[2];
|
||||||
|
}
|
||||||
|
|
||||||
$tag = new DiffusionRepositoryTag();
|
$tag = new DiffusionRepositoryTag();
|
||||||
$tag->setAuthor($author);
|
$tag->setAuthor($author);
|
||||||
|
|
Loading…
Reference in a new issue