Prefer .gitconfig username
We should check first the .gitconfig username and then the environment variables. Otherwise, the .gitconfig username is never used. Bug: #1223676 Change-Id: I3b7efd53e1e561108b42a471ddcebfd87984922b
This commit is contained in:
parent
19e8041cdc
commit
7c6c5f3f2d
@ -284,9 +284,9 @@ def add_remote(hostname, port, project, remote):
|
||||
"""Adds a gerrit remote."""
|
||||
asked_for_username = False
|
||||
|
||||
username = os.getenv("USERNAME")
|
||||
username = git_config_get_value("gitreview", "username")
|
||||
if not username:
|
||||
username = git_config_get_value("gitreview", "username")
|
||||
username = os.getenv("USERNAME")
|
||||
if not username:
|
||||
username = os.getenv("USER")
|
||||
if port is None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user