git_superproject: Replace walrus operator

It was released in python 3.8, and repo still supports 3.6.

Bug: 422226033
Change-Id: I6bdd2cdbb074766ecfb1492d842c847781c4b264
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/481201
Tested-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Gavin Mak 2025-06-03 21:06:42 -07:00
parent 08815ad3eb
commit 0cb88a8d79

View File

@ -173,9 +173,11 @@ class Superproject:
Then the repo_id would be:
android/platform/superproject
"""
if review_url := self.remote.review:
review_url = self.remote.review
if review_url:
parsed_url = urllib.parse.urlparse(review_url)
if netloc := parsed_url.netloc:
netloc = parsed_url.netloc
if netloc:
parts = netloc.split("-review", 1)
host = parts[0]
rev = GitRefs(self._work_git).get("HEAD")