Skip to content

Commit 7da0303

Browse files
committed
try to be compatible to python2.7
1 parent 364a7c9 commit 7da0303

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

git/repo/base.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,9 @@ def __init__(self, path=None, odbt=GitCmdObjectDB, search_parent_directories=Fal
150150
# the current working directory is regarded as the top level of your working tree.
151151
self._working_tree_dir = os.path.dirname(self.git_dir)
152152
if os.environ.get('GIT_COMMON_DIR') is None:
153-
self._working_tree_dir = self.config_reader("repository").get(
154-
'core', 'worktree', fallback=self._working_tree_dir)
153+
gitconf = self.config_reader("repository")
154+
if gitconf.has_option('core', 'worktree'):
155+
self._working_tree_dir = gitconf.get('core', 'worktree')
155156
self._working_tree_dir = os.getenv('GIT_WORK_TREE', self._working_tree_dir)
156157
break
157158

0 commit comments

Comments
 (0)