@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhabricatorOwnerPathQuery extends Phobject {
4
5 public static function loadAffectedPaths(
6 PhabricatorRepository $repository,
7 PhabricatorRepositoryCommit $commit,
8 PhabricatorUser $user) {
9
10 $drequest = DiffusionRequest::newFromDictionary(
11 array(
12 'user' => $user,
13 'repository' => $repository,
14 'commit' => $commit->getCommitIdentifier(),
15 ));
16
17 $path_query = DiffusionPathChangeQuery::newFromDiffusionRequest(
18 $drequest);
19 $paths = $path_query->loadChanges();
20
21 $result = array();
22 foreach ($paths as $path) {
23 $basic_path = '/'.$path->getPath();
24 if ($path->getFileType() == DifferentialChangeType::FILE_DIRECTORY) {
25 $basic_path = rtrim($basic_path, '/').'/';
26 }
27 $result[] = $basic_path;
28 }
29 return $result;
30 }
31
32}