diff options
author | Athos Ribeiro <athos@redhat.com> | 2020-10-20 14:51:31 +0200 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2020-10-22 14:17:36 +0800 |
commit | c96476be7f10616768584a95d06cd1bddfe6d404 (patch) | |
tree | e6a56fea100a066f3dd62fa58ca0f347357840ad /git/cmd.py | |
parent | 0c6e67013fd22840d6cd6cb1a22fcf52eecab530 (diff) | |
download | gitpython-c96476be7f10616768584a95d06cd1bddfe6d404.tar.gz |
Get system user id in a lazy manner
Calling getpass.getuser may lead to breakage in environments where there
is no entries in the /etc/passwd file for the current user.
Setting the environment variables for the git user configurations should
prevents GitPython from using values from /etc/passwd. However, doing so
will not prevent reading /etc/passwd and looking for an entry with the
current user UID.
This patch changes the behavior described above so GitPython will
perform a lazy evaluation of /etc/passwd, only doing so when the
environment variables for the git user configuration are not available.
Signed-off-by: Athos Ribeiro <athos@redhat.com>
Diffstat (limited to 'git/cmd.py')
0 files changed, 0 insertions, 0 deletions