Skip to content

Commit 7c9e7a7

Browse files
committed
Fix getting config from git config
Currently the CLI will store to the Config object values from the argument parsing regardless of whether they are None or not. But if config.xxx is created, even with a None value the __getattr__ will never get called and thus will never lookup the git config value. The fix is to only store non-None values from the argument parsing to the Config object.
1 parent 063f130 commit 7c9e7a7

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

git_pw/shell.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,18 @@ def cli(
9797
"""
9898
logger.configure_verbosity(debug)
9999

100-
CONF.debug = debug
101-
CONF.token = token
102-
CONF.username = username
103-
CONF.password = password
104-
CONF.server = server
105-
CONF.project = project
100+
if debug:
101+
CONF.debug = debug
102+
if token:
103+
CONF.token = token
104+
if username:
105+
CONF.username = username
106+
if password:
107+
CONF.password = password
108+
if server:
109+
CONF.server = server
110+
if project:
111+
CONF.project = project
106112

107113

108114
@cli.group()

0 commit comments

Comments
 (0)