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:
@@ -6,6 +6,12 @@ final class DiffusionRepositoryDefaultController extends DiffusionController {
|
||||
// NOTE: This controller is just here to make sure we call
|
||||
// willBeginExecution() on any /diffusion/X/ URI, so we can intercept
|
||||
// `git`, `hg` and `svn` HTTP protocol requests.
|
||||
return new Aphront404Response();
|
||||
|
||||
// If we made it here, it's probably because the user copy-pasted a
|
||||
// clone URI with "/anything.git" at the end into their web browser.
|
||||
// Send them to the canonical repository URI.
|
||||
|
||||
return id(new AphrontRedirectResponse())
|
||||
->setURI($this->getDiffusionRequest()->getRepository()->getURI());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user