mirror of
https://gerrit.googlesource.com/git-repo
synced 2026-01-12 01:20:26 +00:00
git_superproject: fix AttributeError in Superproject logging
Ensure _git_event_log is initialized before use in _LogMessage. This avoids crashes when _git_event_log is accessed before it's set, such as during repo info. Bug: 435317391 Change-Id: I3adc32d6a9377558e852bbb43f9cf82041fcf1bc Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/498521 Commit-Queue: Gavin Mak <gavinmak@google.com> Tested-by: Gavin Mak <gavinmak@google.com> Reviewed-by: Scott Lee <ddoman@google.com>
This commit is contained in:
@@ -190,6 +190,7 @@ class Superproject:
|
||||
message = f"{self._LogMessagePrefix()} {fmt.format(*inputs)}"
|
||||
if self._print_messages:
|
||||
print(message, file=sys.stderr)
|
||||
if self._git_event_log:
|
||||
self._git_event_log.ErrorEvent(message, fmt)
|
||||
|
||||
def _LogMessagePrefix(self):
|
||||
|
||||
Reference in New Issue
Block a user