Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5fac8d4

Browse files
committed
fix(repo): Use GIT_DIR only if no repo-path given
FIX#535 according to Byron's comment:#535 (comment)
1 parenta25365f commit5fac8d4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎git/repo/base.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ def __init__(self, path=None, odbt=DefaultDBType, search_parent_directories=Fals
100100
repo = Repo("$REPOSITORIES/Development/git-python.git")
101101
102102
- In *Cygwin*, path may be a `'cygdrive/...'` prefixed path.
103-
- If`None, current-directory is used.
104-
- The :envvar:`GIT_DIR` if set and not empty takes precendance over this parameter.
103+
- Ifit evaluates to false, :envvar:`GIT_DIR` is used, and if this also evals to false,
104+
the current-directory is used.
105105
:param odbt:
106106
Object DataBase type - a type which is constructed by providing
107107
the directory containing the database objects, i.e. .git/objects. It will
@@ -114,7 +114,9 @@ def __init__(self, path=None, odbt=DefaultDBType, search_parent_directories=Fals
114114
:raise InvalidGitRepositoryError:
115115
:raise NoSuchPathError:
116116
:return: git.Repo """
117-
epath=os.getenv('GIT_DIR')orpathoros.getcwd()
117+
epath=pathoros.getenv('GIT_DIR')
118+
ifnotepath:
119+
epath=os.getcwd()
118120
ifGit.is_cygwin():
119121
epath=decygpath(epath)
120122
epath=_expand_path(epathorpathoros.getcwd())

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp