Repository: cookiecutter/cookiecutter

Issue:
Problem with --checkout reclone
The message should ask me about recloning `/Users/audreyr/.cookiecutters/cookiecutter-pypackage`, not `/Users/audreyr/.cookiecutters`.

```
$ cookiecutter https://github.com/eliasdorneles/cookiecutter-pypackage/ -c adding-travis-setup-for-pypi-deployment
You've cloned /Users/audreyr/.cookiecutters before. Is it okay to delete and re-clone it? [yes]: 
```



Discussion:
It works just fine if the url to the template is as follows (without the `/` at the very end) :no_mouth: 

``` bash
https://github.com/eliasdorneles/cookiecutter-pypackage
```

```
(cookiecutter)[raphael@hackebook cookiecutter (fix-re-clone-prompt)]$ cookiecutter https://github.com/eliasdorneles/cookiecutter-pypackage -c adding-travis-setup-for-pypi-deployment
You've cloned /Users/raphael/.cookiecutters/cookiecutter-pypackage before. Is it okay to delete and re-clone it? [yes]: 
Cloning into 'cookiecutter-pypackage'...
remote: Counting objects: 609, done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 609 (delta 10), reused 0 (delta 0), pack-reused 585
Receiving objects: 100% (609/609), 95.98 KiB | 95.00 KiB/s, done.
Resolving deltas: 100% (319/319), done.
Checking connectivity... done.
Branch adding-travis-setup-for-pypi-deployment set up to track remote branch adding-travis-setup-for-pypi-deployment from origin.
Switched to a new branch 'adding-travis-setup-for-pypi-deployment'
full_name [Raphael Pierzina]: 
email [raphael@hackebrot.de]: 
github_username [hackebrot]: 
project_name [Python Boilerplate]: 
repo_name [boilerplate]: 
project_short_description [Python Boilerplate contains all the boilerplate you need to create a Python package.]: 
release_date [2015-01-11]: 
pypi_username [hackebrot]: 
year [2015]: 
version [0.1.0]: 
use_pypi_deployment_with_travis [y]: 
Error: "boilerplate" directory already exists
```

Hey @audreyr! :wave: 

What's your opinion on this guy? Shall we change anything?

Thanks for figuring this out @hackebrot. Okay, this is a bug, but I'll take off the 1.1.1 milestone since it's known behavior and not absolutely urgent.


Resolving patch:
diff --git a/cookiecutter/vcs.py b/cookiecutter/vcs.py
--- a/cookiecutter/vcs.py
+++ b/cookiecutter/vcs.py
@@ -103,6 +103,7 @@ def clone(repo_url, checkout=None, clone_to_dir=".", no_input=False):
         msg = "'{0}' is not installed.".format(repo_type)
         raise VCSNotInstalled(msg)
 
+    repo_url = repo_url.rstrip('/')
     tail = os.path.split(repo_url)[1]
     if repo_type == 'git':
         repo_dir = os.path.normpath(os.path.join(clone_to_dir,


Test patch:
diff --git a/tests/test_vcs.py b/tests/test_vcs.py
--- a/tests/test_vcs.py
+++ b/tests/test_vcs.py
@@ -32,6 +32,19 @@ def test_git_clone():
         utils.rmtree('cookiecutter-pypackage')
 
 
+@skipif_no_network
+def test_git_clone_with_trailing_slash():
+    repo_dir = vcs.clone(
+        'https://github.com/audreyr/cookiecutter-pypackage/'
+    )
+
+    assert repo_dir == 'cookiecutter-pypackage'
+    assert os.path.isfile('cookiecutter-pypackage/README.rst')
+
+    if os.path.isdir('cookiecutter-pypackage'):
+        utils.rmtree('cookiecutter-pypackage')
+
+
 @skipif_no_network
 def test_git_clone_checkout():
     repo_dir = vcs.clone(