diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-03-17 10:21:07 +0000 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2023-03-17 09:57:56 -0400 |
commit | 20972c58601f9a6ff4440e23be8d6261c6bc5b93 (patch) | |
tree | 9bef1e8580d7da24132e407041f4db3b93435045 | |
parent | 7c06ad19f6a94d367355e5ae8211c409404c7d7d (diff) | |
download | b4-20972c58601f9a6ff4440e23be8d6261c6bc5b93.tar.gz |
Fall back to EMAIL environment email
This matches git's behavior. Without this change, b4 shazam would
catch the KeyError and exit 1 with no error message. This will still
happen if EMAIL is also unset.
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Link: https://msgid.link/20230317102107.17422-1-hi@alyssa.is
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/__init__.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/b4/__init__.py b/b4/__init__.py index 4ed8ad8..d3e1bb6 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -2582,6 +2582,8 @@ def get_user_config(): if 'name' not in USER_CONFIG: udata = pwd.getpwuid(os.getuid()) USER_CONFIG['name'] = udata.pw_gecos + if 'email' not in USER_CONFIG: + USER_CONFIG['email'] = os.environ['EMAIL'] return USER_CONFIG |