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

Make directories with spaces in their names work OK in diffusion end to end

Summary:
we were parsing the git log output slightly incorrectly and over-exploding on spaces. we also needed to escape the path %20 stuff`.

Not sure if there's something fancy to do given folks should reparse their repos if they are impacted by this issue.

Test Plan:
made a directory with spaces and some dummy revisions. observed diffs wouldn't load and links broken.
with patch, ran scripts/reparse.php for pertinent revisions and diffs loaded and links weren't broken.

Reviewers: floatinglomas, epriestley

Reviewed By: epriestley

CC: aran, Koolvin

Maniphest Tasks: T1252

Differential Revision: https://secure.phabricator.com/D2510
This commit is contained in:
Bob Trahan 2012-05-20 15:29:36 -07:00
parent b624dc4e7b
commit 80f479d948
2 changed files with 2 additions and 2 deletions

View file

@ -418,7 +418,7 @@ abstract class DiffusionRequest {
// This isn't a real URI per se, it's passed as a query parameter to // This isn't a real URI per se, it's passed as a query parameter to
// the ajax changeset stuff but then we parse it back out as though // the ajax changeset stuff but then we parse it back out as though
// it came from a URI. // it came from a URI.
$uri = "{$path}{$commit}"; $uri = rawurldecode("{$path}{$commit}");
break; break;
case 'commit': case 'commit':
$commit = ltrim($commit, ';'); $commit = ltrim($commit, ';');

View file

@ -73,7 +73,7 @@ final class PhabricatorRepositoryGitCommitChangeParserWorker
} }
list($old_mode, $new_mode, list($old_mode, $new_mode,
$old_hash, $new_hash, $old_hash, $new_hash,
$more_stuff) = preg_split('/ +/', $line); $more_stuff) = preg_split('/ +/', $line, 5);
// We may only have two pieces here. // We may only have two pieces here.
list($action, $src_path, $dst_path) = array_merge( list($action, $src_path, $dst_path) = array_merge(