]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Properly URL encode branches in `arc browse --branch ...`
authorepriestley <git@epriestley.com>
Fri, 4 Mar 2016 23:49:35 +0000 (15:49 -0800)
committerepriestley <git@epriestley.com>
Fri, 4 Mar 2016 23:52:58 +0000 (15:52 -0800)
Summary: Fixes T10511. If you `arc browse --branch x/y/z`, we do not encode the URI properly.

Test Plan:
Ran `arc browse --branch x/y/z/ something.c`.

Before, got an error about "x" does not exist. This is wrong; the error should be about "x/y/z".

After, got the proper error:

{F1141096}

Reviewers: chad, avivey

Reviewed By: avivey

Maniphest Tasks: T10511

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

src/workflow/ArcanistBrowseWorkflow.php

index 76aa66dd6867d14213624d566f0278e7a9edf689..64d8f84a3970482ad11f4a4ec39145ae13efe9ac 100644 (file)
@@ -225,6 +225,7 @@ EOTEXT
     }
 
     $branch = $this->getArgument('branch', 'master');
+    $branch = phutil_escape_uri_path_component($branch);
 
     return $repo_uri.'browse/'.$branch.'/';
   }