From c71a5fc0c967e223a025da56d7f872f29aff1827 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 24 Sep 2013 05:44:02 -0700 Subject: [PATCH] Fix generation of "branch" URIs in Subversion repositories Summary: "Branch" really means "repository main screen, with some branch selected", so a branch isn't actually required since we can just take you to the default. Fixes an issue where new crumbs would throw an exception in SVN repositories. Test Plan: Browed an SVN repo. Reviewers: btrahan, mbishopim3 Reviewed By: mbishopim3 CC: aran Differential Revision: https://secure.phabricator.com/D7099 --- .../diffusion/request/DiffusionRequest.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/applications/diffusion/request/DiffusionRequest.php b/src/applications/diffusion/request/DiffusionRequest.php index b346d7af99..99d73dd08e 100644 --- a/src/applications/diffusion/request/DiffusionRequest.php +++ b/src/applications/diffusion/request/DiffusionRequest.php @@ -450,11 +450,6 @@ abstract class DiffusionRequest { "Diffusion URI action '{$action}' requires callsign!"); } - if ($req_branch && !strlen($branch)) { - throw new Exception( - "Diffusion URI action '{$action}' requires branch!"); - } - if ($req_commit && !strlen($commit)) { throw new Exception( "Diffusion URI action '{$action}' requires commit!"); @@ -471,7 +466,11 @@ abstract class DiffusionRequest { $uri = "/diffusion/{$callsign}{$action}/{$path}{$commit}{$line}"; break; case 'branch': - $uri = "/diffusion/{$callsign}repository/{$path}"; + if (strlen($path)) { + $uri = "/diffusion/{$callsign}repository/{$path}"; + } else { + $uri = "/diffusion/{$callsign}"; + } break; case 'external': $commit = ltrim($commit, ';');