@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
fork

Configure Feed

Select the types of activity you want to include in your feed.

Correct Git repository browse behavior for differences in "ls-tree" output

Summary:
Ref T13589. The output for "git ls-tree commit:path" (the old invocation) and "git ls-tree commit -- path" (the new invocation) differs: the latter emits absolute paths.

Update the code to account for this difference in behavior.

Test Plan:
- Browsed a non-root directory in a Git repository in Diffusion.
- Before: saw absolute paths.
- After: saw relative paths.

Maniphest Tasks: T13589

Differential Revision: https://secure.phabricator.com/D21519

+9 -9
+9 -9
src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php
··· 138 138 139 139 $submodules = array(); 140 140 141 - if ($path !== null) { 142 - $prefix = rtrim($path, '/').'/'; 143 - } else { 144 - $prefix = ''; 145 - } 146 - 147 141 $count = 0; 148 142 $results = array(); 149 143 $lines = empty($stdout) ··· 166 160 $line)); 167 161 } 168 162 169 - list($mode, $type, $hash, $size, $name) = $parts; 163 + list($mode, $type, $hash, $size, $full_path) = $parts; 170 164 171 165 $path_result = new DiffusionRepositoryPath(); 172 166 ··· 184 178 } 185 179 } 186 180 187 - $path_result->setFullPath($prefix.$name); 188 - $path_result->setPath($name); 181 + if ($path === null) { 182 + $local_path = $full_path; 183 + } else { 184 + $local_path = basename($full_path); 185 + } 186 + 187 + $path_result->setFullPath($full_path); 188 + $path_result->setPath($local_path); 189 189 $path_result->setHash($hash); 190 190 $path_result->setFileType($file_type); 191 191 $path_result->setFileSize($size);