Skip to content

Commit

Permalink
cygwin, #533: Polish also --git-separate-dir
Browse files Browse the repository at this point in the history
- Cygwin TCs failing:
  - PY2: err: 13, fail: 3
  - PY3: err: 12, fail: 3
  • Loading branch information
ankostis committed Oct 14, 2016
1 parent 0bce7cc commit 57d0537
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions git/repo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,15 +851,18 @@ def _clone(cls, git, url, path, odb_default_type, progress, **kwargs):

odbt = kwargs.pop('odbt', odb_default_type)

## A bug win cygwin's Git, when `--bare`
# it prepends the basename of the `url` into the `path::
# git clone --bare /cygwin/a/foo.git C:\\Work
## A bug win cygwin's Git, when `--bare` or `--separate-git-dir`
# it prepends the cwd or(?) the `url` into the `path, so::
# git clone --bare /cygwin/d/foo.git C:\\Work
# becomes::
# git clone --bare /cygwin/a/foo.git /cygwin/a/C:\\Work
# git clone --bare /cygwin/d/foo.git /cygwin/d/C:\\Work
#
clone_path = (Git.polish_url(path)
if Git.is_cygwin() and 'bare' in kwargs
if Git.is_cygwin() and 'bare'in kwargs
else path)
sep_dir = kwargs.get('separate_git_dir')
if sep_dir:
kwargs['separate_git_dir'] = Git.polish_url(sep_dir)
proc = git.clone(Git.polish_url(url), clone_path, with_extended_output=True, as_process=True,
v=True, **add_progress(kwargs, git, progress))
if progress:
Expand Down

0 comments on commit 57d0537

Please sign in to comment.