aboutsummaryrefslogtreecommitdiff
path: root/git
diff options
context:
space:
mode:
Diffstat (limited to 'git')
-rw-r--r--git/repo/base.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/git/repo/base.py b/git/repo/base.py
index f3a04cf4..0f85e3d9 100644
--- a/git/repo/base.py
+++ b/git/repo/base.py
@@ -100,8 +100,8 @@ class Repo(object):
repo = Repo("$REPOSITORIES/Development/git-python.git")
- In *Cygwin*, path may be a `'cygdrive/...'` prefixed path.
- - If `None, current-directory is used.
- - The :envvar:`GIT_DIR` if set and not empty takes precendance over this parameter.
+ - If it evaluates to false, :envvar:`GIT_DIR` is used, and if this also evals to false,
+ the current-directory is used.
:param odbt:
Object DataBase type - a type which is constructed by providing
the directory containing the database objects, i.e. .git/objects. It will
@@ -114,7 +114,9 @@ class Repo(object):
:raise InvalidGitRepositoryError:
:raise NoSuchPathError:
:return: git.Repo """
- epath = os.getenv('GIT_DIR') or path or os.getcwd()
+ epath = path or os.getenv('GIT_DIR')
+ if not epath:
+ epath = os.getcwd()
if Git.is_cygwin():
epath = decygpath(epath)
epath = _expand_path(epath or path or os.getcwd())