diff options
author | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-14 16:43:52 +0200 |
---|---|---|
committer | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-14 17:43:18 +0200 |
commit | 3b1cfcc629e856b1384b811b8cf30b92a1e34fe1 (patch) | |
tree | 92d3d7b5a03b1626ae9aa01db0dafcd6837cd34f /git/repo/base.py | |
parent | 57d053792d1cde6f97526d28abfae4928a61e20f (diff) | |
download | gitpython-3b1cfcc629e856b1384b811b8cf30b92a1e34fe1.tar.gz |
cygwin, #533: Allow '/cygdrive/c/' paths on repo init
- Cygwin TCs failing:
- PY2: err: 13, fail: 2
- PY3: err: 12, fail: 2
Diffstat (limited to 'git/repo/base.py')
-rw-r--r-- | git/repo/base.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/git/repo/base.py b/git/repo/base.py index 077ba4af..6355615e 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -35,7 +35,7 @@ from git.index import IndexFile from git.objects import Submodule, RootModule, Commit from git.refs import HEAD, Head, Reference, TagReference from git.remote import Remote, add_progress, to_progress_instance -from git.util import Actor, finalize_process +from git.util import Actor, finalize_process, decygpath from .fun import rev_parse, is_git_dir, find_git_dir, touch @@ -99,6 +99,8 @@ class Repo(object): repo = Repo("~/Development/git-python.git") repo = Repo("$REPOSITORIES/Development/git-python.git") + In *Cygwin*, path may be a `'cygdrive/...'` prefixed path. + :param odbt: Object DataBase type - a type which is constructed by providing the directory containing the database objects, i.e. .git/objects. It will @@ -111,6 +113,9 @@ class Repo(object): :raise InvalidGitRepositoryError: :raise NoSuchPathError: :return: git.Repo """ + if path and Git.is_cygwin(): + path = decygpath(path) + epath = _expand_path(path or os.getcwd()) self.git = None # should be set for __del__ not to fail in case we raise if not os.path.exists(epath): |