From 8bba3f280dbd7be8ab8d795976c492ec0f537107 Mon Sep 17 00:00:00 2001 From: Andrew Gallagher Date: Tue, 3 Sep 2013 18:22:01 -0700 Subject: [PATCH] Only associate branch with task if maniphest is enabled Summary: Previously, maniphest tasks would get upated by diffs on branches with tasky names, even if maniphest was disabled. Test Plan: Tested createing a diff in sandbox with maniphest disabled, on a git branch named using the format "t###". Without this change, if there happened to be a task in the maniphest DB which matched, it was updated an email was sent to users. Reviewers: epriestley Reviewed By: epriestley CC: wez, slawekbiel, whhone, Korvin, aran Differential Revision: https://secure.phabricator.com/D6881 --- .../specification/DifferentialBranchFieldSpecification.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/applications/differential/field/specification/DifferentialBranchFieldSpecification.php b/src/applications/differential/field/specification/DifferentialBranchFieldSpecification.php index c2563cb2c3..22dbbee717 100644 --- a/src/applications/differential/field/specification/DifferentialBranchFieldSpecification.php +++ b/src/applications/differential/field/specification/DifferentialBranchFieldSpecification.php @@ -47,6 +47,11 @@ final class DifferentialBranchFieldSpecification } public function didWriteRevision(DifferentialRevisionEditor $editor) { + $maniphest = 'PhabricatorApplicationManiphest'; + if (!PhabricatorApplication::isClassInstalled($maniphest)) { + return; + } + $branch = $this->getDiff()->getBranch(); $match = null; if (preg_match('/^T(\d+)/i', $branch, $match)) { // No $ to allow T123_demo.