From 80f479d94812190296e66518c056de1fef4f100f Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Sun, 20 May 2012 15:29:36 -0700 Subject: [PATCH] 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 --- src/applications/diffusion/request/base/DiffusionRequest.php | 2 +- .../git/PhabricatorRepositoryGitCommitChangeParserWorker.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/applications/diffusion/request/base/DiffusionRequest.php b/src/applications/diffusion/request/base/DiffusionRequest.php index a9f2e5cbb9..e179c38d12 100644 --- a/src/applications/diffusion/request/base/DiffusionRequest.php +++ b/src/applications/diffusion/request/base/DiffusionRequest.php @@ -418,7 +418,7 @@ abstract class DiffusionRequest { // 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 // it came from a URI. - $uri = "{$path}{$commit}"; + $uri = rawurldecode("{$path}{$commit}"); break; case 'commit': $commit = ltrim($commit, ';'); diff --git a/src/applications/repository/worker/commitchangeparser/git/PhabricatorRepositoryGitCommitChangeParserWorker.php b/src/applications/repository/worker/commitchangeparser/git/PhabricatorRepositoryGitCommitChangeParserWorker.php index 6ddbb67223..7943ff5559 100644 --- a/src/applications/repository/worker/commitchangeparser/git/PhabricatorRepositoryGitCommitChangeParserWorker.php +++ b/src/applications/repository/worker/commitchangeparser/git/PhabricatorRepositoryGitCommitChangeParserWorker.php @@ -73,7 +73,7 @@ final class PhabricatorRepositoryGitCommitChangeParserWorker } list($old_mode, $new_mode, $old_hash, $new_hash, - $more_stuff) = preg_split('/ +/', $line); + $more_stuff) = preg_split('/ +/', $line, 5); // We may only have two pieces here. list($action, $src_path, $dst_path) = array_merge(