8000 Handle trailing slash on url. fix #546. by ramiroluz · Pull Request #573 · cookiecutter/cookiecutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Handle trailing slash on url. fix #546. #573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file 8000
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cookiecutter/vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
13 changes: 13 additions & 0 deletions tests/test_vcs.py
Original file line numbe 73DA r Diff line number Diff line change
Expand Up @@ -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(
Expand Down
0