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

read workdir from git.config as referenced in man 1 git-config#801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Closed
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletiongit/repo/base.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -140,7 +140,20 @@ def __init__(self, path=None, odbt=GitCmdObjectDB, search_parent_directories=Fal
# removed. It's just cleaner.
if is_git_dir(curpath):
self.git_dir = curpath
self._working_tree_dir = os.getenv('GIT_WORK_TREE', os.path.dirname(self.git_dir))
# from man git-config : core.worktree
# Set the path to the root of the working tree. If GIT_COMMON_DIR environment
# variable is set, core.worktree is ignored and not used for determining the
# root of working tree. This can be overridden by the GIT_WORK_TREE environment
# variable. The value can be an absolute path or relative to the path to the .git
# directory, which is either specified by GIT_DIR, or automatically discovered.
# If GIT_DIR is specified but none of GIT_WORK_TREE and core.worktree is specified,
# the current working directory is regarded as the top level of your working tree.
self._working_tree_dir = os.path.dirname(self.git_dir)
if os.environ.get('GIT_COMMON_DIR') is None:
gitconf = self.config_reader("repository")
if gitconf.has_option('core', 'worktree'):
self._working_tree_dir = gitconf.get('core', 'worktree')
self._working_tree_dir = os.getenv('GIT_WORK_TREE', self._working_tree_dir)
break

dotgit = osp.join(curpath, '.git')
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp