File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff 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 if config_level == "system" :
355355 return "/etc/gitconfig"
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" )
356363 elif config_level == "global" :
357364 return os .path .normpath (os .path .expanduser ("~/.gitconfig" ))
358365 elif config_level == "repository" :
You can’t perform that action at this time.
0 commit comments