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

Commit597bc56

Browse files
committed
Added 'user' configuration level.
Fixesgitpython-developers#160
1 parentbecf5ef commit597bc56

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎git/repo/base.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class Repo(object):
9797

9898
# invariants
9999
# represents the configuration level of a configuration file
100-
config_level= ("system","global","repository")
100+
config_level= ("system","user","global","repository")
101101

102102
def__init__(self,path=None,odbt=DefaultDBType,search_parent_directories=False):
103103
"""Create a new Repo instance
@@ -353,6 +353,13 @@ def _get_config_path(self, config_level):
353353

354354
ifconfig_level=="system":
355355
return"/etc/gitconfig"
356+
elifconfig_level=="user":
357+
forevarin ("XDG_CONFIG_HOME","HOME"):
358+
ifevarnotinos.environ:
359+
continue
360+
returnos.path.join(os.environ[evar],'.config/git/config')
361+
# end for each evar to check
362+
raiseAssertionError("Didn't find a single HOME related environment variable")
356363
elifconfig_level=="global":
357364
returnos.path.normpath(os.path.expanduser("~/.gitconfig"))
358365
elifconfig_level=="repository":

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp