superproject: Fix crash when _git_event_log is None
File "${AOSP_ROOT}/.repo/repo/subcmds/info.py", line 106, in Execute srev = sp.commit_id if sp and sp.commit_id else "None" ^^^^^^^^^^^^ File "${AOSP_ROOT}/.repo/repo/git_superproject.py", line 146, in commit_id self._LogWarning( ~~~~~~~~~~~~~~~~^ "git rev-parse call failed, command: git {}, " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<3 lines>... p.stderr, ^^^^^^^^^ ) ^ File "${AOSP_ROOT}/.repo/repo/git_superproject.py", line 207, in _LogWarning self._LogMessage(f"warning: {fmt}", *inputs) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "${AOSP_ROOT}/.repo/repo/git_superproject.py", line 193, in _LogMessage self._git_event_log.ErrorEvent(message, fmt) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'ErrorEvent' Test: repo info -o with and without superproject Change-Id: I3267eccd09df3a7bc71f9461be807dedd8082cfb
This commit is contained in:
parent
85352825ff
commit
233145f080
1 changed files with 2 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue