Skip to content

Commit 3d93100

Browse files
committed
util.get_user_id(): Will try a windows environment variable as well, the method now yields good results on all tested platforms
1 parent 6942656 commit 3d93100

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/git/objects/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def get_user_id():
6060
""":return: string identifying the currently active system user as name@node
6161
:note: user can be set with the 'USER' environment variable, usually set on windows"""
6262
ukn = 'UNKNOWN'
63-
username = os.environ.get('USER', ukn)
63+
username = os.environ.get('USER', os.environ.get('USERNAME', ukn))
6464
if username == ukn and hasattr(os, 'getlogin'):
6565
username = os.getlogin()
6666
# END get username from login

0 commit comments

Comments
 (0)