Allow Git and Mercurial repositories to be cloned with names in the URI

Summary:
Ref T4175. This allows these URIs to all be valid for Git and Mercurial:

  /diffusion/X/
  /diffusion/X/anything.git
  /diffusion/X/anything/

This mostly already works, it just needed a few tweaks.

Test Plan: Cloned git and hg working copies using HTTP and SSH.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T4175

Differential Revision: https://secure.phabricator.com/D8098
This commit is contained in:
epriestley
2014-01-30 11:42:25 -08:00
parent ffeee37810
commit c41b4cfac0
6 changed files with 63 additions and 12 deletions

View File

@@ -551,15 +551,13 @@ final class DiffusionRepositoryController extends DiffusionController {
switch ($repository->getVersionControlSystem()) {
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
$command = csprintf(
'git clone %s %s',
$uri,
$repository->getCloneName());
'git clone %s',
$uri);
break;
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
$command = csprintf(
'hg clone %s %s',
$uri,
$repository->getCloneName());
'hg clone %s',
$uri);
break;
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
$command = csprintf(