From 809c7fb4f35ea6a204dd70f8ac48f8044f801a24 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 1 Sep 2015 08:07:06 -0700 Subject: [PATCH] Fix an issue where paths could bleed across repos in Owners Summary: Ref T8320. I missed this a while ago and then it came to me in a dream. Only consider paths in the same repo when looking at ownership. (I think this is rarely reachable in practice.) Test Plan: Verified that files and commits still listed ownership properly. Reviewers: chad Reviewed By: chad Maniphest Tasks: T8320 Differential Revision: https://secure.phabricator.com/D14022 --- .../owners/query/PhabricatorOwnersPackageQuery.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/applications/owners/query/PhabricatorOwnersPackageQuery.php b/src/applications/owners/query/PhabricatorOwnersPackageQuery.php index f57ddf5a58..ef6a1e1a67 100644 --- a/src/applications/owners/query/PhabricatorOwnersPackageQuery.php +++ b/src/applications/owners/query/PhabricatorOwnersPackageQuery.php @@ -372,6 +372,11 @@ final class PhabricatorOwnersPackageQuery $include = false; foreach ($package->getPaths() as $package_path) { + if ($package_path->getRepositoryPHID() != $repository_phid) { + // If this path is for some other repository, skip it. + continue; + } + $strength = $package_path->getPathMatchStrength($path); if ($strength > $best_match) { $best_match = $strength;