1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

Only load refs that are actual commits

Summary: Fix T11301. Git is git.

Test Plan: tagged a file! run discover. no crash.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin

Maniphest Tasks: T11301

Differential Revision: https://secure.phabricator.com/D16261
This commit is contained in:
Aviv Eyal 2016-07-08 22:34:25 +00:00 committed by avivey
parent 1a303e7d2a
commit c56a4fce66
3 changed files with 6 additions and 4 deletions

View file

@ -174,12 +174,13 @@ final class PhabricatorRepositoryDiscoveryEngine
continue;
}
// In Git, it's possible to tag a tag. We just skip these, we'll discover
// them when we process the target tag. See T11180.
// In Git, it's possible to tag anything. We just skip tags that don't
// point to a commit. See T11301.
$fields = $ref->getRawFields();
$ref_type = idx($fields, 'objecttype');
$tag_type = idx($fields, '*objecttype');
if ($tag_type == 'tag') {
$this->log(pht('Skipping, this is a tag of a tag.'));
if ($ref_type != 'commit' && $tag_type != 'commit') {
$this->log(pht('Skipping, this is not a commit.'));
continue;
}

View file

@ -30,6 +30,7 @@ final class PhabricatorWorkingCopyDiscoveryTestCase
$this->assertEqual(
array(
'763d4ab372445551c95fb5cccd1a7a223f5b2ac8',
'41fa35914aa19c1aa6e57004d9745c05929c3563',
),
mpull($refs, 'getIdentifier'));
}