- config.readfp(git_config(os.path.expanduser('~/.gitconfig')))
- config.readfp(git_config(os.path.join(basedir.get(), 'config')))
+ try:
+ global_config = os.environ['GIT_CONFIG']
+ except KeyError:
+ global_config = os.path.expanduser('~/.gitconfig')
+ try:
+ local_config = os.environ['GIT_CONFIG_LOCAL']
+ except KeyError:
+ local_config = os.path.join(basedir.get(), 'config')
+ config.readfp(git_config(global_config))
+ config.readfp(git_config(local_config))