| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e84300d commit acd8246
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -354,12 +354,8 @@ def _get_config_path(self, config_level): | |||
| 354 | 354 | if config_level == "system": | |
| 355 | 355 | return "/etc/gitconfig" | |
| 356 | 356 | elif config_level == "user": | |
| 357 | - for evar in ("XDG_CONFIG_HOME", "HOME"): | ||
| 358 | - if evar not in os.environ: | ||
| 359 | - continue | ||
| 360 | - return os.path.join(os.environ[evar], '.config/git/config') | ||
| 361 | - # end for each evar to check | ||
| 362 | - raise AssertionError("Didn't find a single HOME related environment variable") | ||
| 357 | + config_home = os.environ.get("XDG_CONFIG_HOME") or join(os.environ.get("HOME", '~'), ".config") | ||
| 358 | + return os.path.expanduser(join(config_home, "git", "config")) | ||
| 363 | 359 | elif config_level == "global": | |
| 364 | 360 | return os.path.normpath(os.path.expanduser("~/.gitconfig")) | |
| 365 | 361 | elif config_level == "repository": | |
| Back | FazBrowse Home | New Git URL |
0 commit comments