X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/29d9e8ce8e74d9319c3e9979dd8aa267c0de8239..9e3f506f0d0e1b0c09d1e9d7051af23bfede7834:/stgit/config.py diff --git a/stgit/config.py b/stgit/config.py index b56ab1b..2174f09 100644 --- a/stgit/config.py +++ b/stgit/config.py @@ -80,8 +80,16 @@ def config_setup(): config.read(os.path.join(basedir.get(), 'stgitrc')) # GIT configuration files can have a [stgit] section - 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)) # Set the PAGER environment to the config value (if any) if config.has_option('stgit', 'pager'):