@@ -851,15 +851,18 @@ def _clone(cls, git, url, path, odb_default_type, progress, **kwargs):
851
851
852
852
odbt = kwargs .pop ('odbt' ,odb_default_type )
853
853
854
- ## A bug win cygwin's Git, when `--bare`
855
- # it prepends thebasename of the `url` into the `path::
856
- # git clone --bare /cygwin/a /foo.git C:\\Work
854
+ ## A bug win cygwin's Git, when `--bare` or `--separate-git-dir`
855
+ # it prepends thecwd or(?) the `url` into the `path, so ::
856
+ # git clone --bare /cygwin/d /foo.git C:\\Work
857
857
# becomes::
858
- # git clone --bare /cygwin/a /foo.git /cygwin/a /C:\\Work
858
+ # git clone --bare /cygwin/d /foo.git /cygwin/d /C:\\Work
859
859
#
860
860
clone_path = (Git .polish_url (path )
861
- if Git .is_cygwin ()and 'bare' in kwargs
861
+ if Git .is_cygwin ()and 'bare' in kwargs
862
862
else path )
863
+ sep_dir = kwargs .get ('separate_git_dir' )
864
+ if sep_dir :
865
+ kwargs ['separate_git_dir' ]= Git .polish_url (sep_dir )
863
866
proc = git .clone (Git .polish_url (url ),clone_path ,with_extended_output = True ,as_process = True ,
864
867
v = True ,** add_progress (kwargs ,git ,progress ))
865
868
if progress :