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

Commitacd8246

Browse files
committed
Re-implemented 'user' config level based on suggestion by@jzempel
The point is that XDG_CONFIG_HOME is meant to point at the '.config' directory,whereas '.config' has to be added only if HOME is used instead.Fixesgitpython-developers#160
1 parente84300d commitacd8246

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

‎git/repo/base.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,8 @@ def _get_config_path(self, config_level):
354354
ifconfig_level=="system":
355355
return"/etc/gitconfig"
356356
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")
357+
config_home=os.environ.get("XDG_CONFIG_HOME")orjoin(os.environ.get("HOME",'~'),".config")
358+
returnos.path.expanduser(join(config_home,"git","config"))
363359
elifconfig_level=="global":
364360
returnos.path.normpath(os.path.expanduser("~/.gitconfig"))
365361
elifconfig_level=="repository":

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp