merge bot: Do not check result of git config

If the value is not set, treat it as empty.

BUG=None
TEST=Tested by removing the config setting locally.

Change-Id: Ia160285c03bffcf7a332f3891587e7ada2228623
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3585860
Reviewed-by: Anton Romanov <romanton@google.com>
Tested-by: Dennis Kempin <denniskempin@google.com>
This commit is contained in:
Dennis Kempin 2022-04-14 15:41:06 -07:00
parent 45df242c01
commit f334e19ffc
2 changed files with 3 additions and 3 deletions

View file

@ -176,7 +176,7 @@ def setup_tracking_branch(branch_name: str, tracking: str):
def gerrit_prerequisites(): def gerrit_prerequisites():
"Make sure we can upload to gerrit." "Make sure we can upload to gerrit."
# Make sure we have http cookies to access gerrit # Make sure we have http cookies to access gerrit
cookie_file = git("config http.cookiefile").stdout() cookie_file = git("config http.cookiefile").stdout(check=False)
if not cookie_file: if not cookie_file:
if is_gce_instance(): if is_gce_instance():
# Grab http cookies for accessing GOB. See go/gob-gce # Grab http cookies for accessing GOB. See go/gob-gce

View file

@ -180,11 +180,11 @@ class Command(object):
raise subprocess.CalledProcessError(result.returncode, str(self), result.stdout) raise subprocess.CalledProcessError(result.returncode, str(self), result.stdout)
return result.returncode return result.returncode
def stdout(self): def stdout(self, check: bool = True):
""" """
Runs a program and returns stdout. Stderr is still directed to the user. Runs a program and returns stdout. Stderr is still directed to the user.
""" """
return self.run(stderr=None).stdout.strip() return self.run(stderr=None, check=check).stdout.strip()
def lines(self): def lines(self):
""" """