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

Don't track "phabricator/" staging area tags

Summary: Ref T9028. Ref T6878. This rule should probably be refined in the long term, but for now just ignore "phabricator/diff/12424" and similar staging area tags.

Test Plan: Ran `bin/repository discover --verbose` on a repository with staging area refs, saw Phabricator ignore those refs as untracked.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T6878, T9028

Differential Revision: https://secure.phabricator.com/D16134
This commit is contained in:
epriestley 2016-06-16 10:55:13 -07:00
parent 1c63ac6a3a
commit 7c8f9d7ba2
2 changed files with 12 additions and 0 deletions

View file

@ -51,6 +51,11 @@ final class DiffusionRepositoryRef extends Phobject {
return ($this->getRefType() === $type_branch);
}
public function isTag() {
$type_tag = PhabricatorRepositoryRefCursor::TYPE_TAG;
return ($this->getRefType() === $type_tag);
}
/* -( Serialization )------------------------------------------------------ */

View file

@ -911,6 +911,13 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
}
public function shouldTrackRef(DiffusionRepositoryRef $ref) {
// At least for now, don't track the staging area tags.
if ($ref->isTag()) {
if (preg_match('(^phabricator/)', $ref->getShortName())) {
return false;
}
}
if (!$ref->isBranch()) {
return true;
}