diff options
| author | Jason Chang <jasonnc@google.com> | 2023-09-27 11:34:43 -0700 |
|---|---|---|
| committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-09-27 19:05:16 +0000 |
| commit | 87058c6ca5ec2c66d0850f1015de01ec6c0dd758 (patch) | |
| tree | fdd8233c570dadb44dac658137f5a441a87b670e /git_command.py | |
| parent | b5644160b74e70e223caa62ad0ca2ce8310cfb87 (diff) | |
| download | git-repo-87058c6ca5ec2c66d0850f1015de01ec6c0dd758.tar.gz | |
Track expected git errors in logs
Sometimes it is expected that a GitCommand executed in repo fails. In
such cases indicate in trace logs that the error was expected.
Bug: b/293344017
Change-Id: If137fae9ef9769258246f5b4494e070345db4a71
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/387714
Commit-Queue: Jason Chang <jasonnc@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Tested-by: Jason Chang <jasonnc@google.com>
Diffstat (limited to 'git_command.py')
| -rw-r--r-- | git_command.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/git_command.py b/git_command.py index 71b464c6..fe1e48d6 100644 --- a/git_command.py +++ b/git_command.py | |||
| @@ -286,6 +286,7 @@ class GitCommand(object): | |||
| 286 | objdir=None, | 286 | objdir=None, |
| 287 | verify_command=False, | 287 | verify_command=False, |
| 288 | add_event_log=True, | 288 | add_event_log=True, |
| 289 | log_as_error=True, | ||
| 289 | ): | 290 | ): |
| 290 | if project: | 291 | if project: |
| 291 | if not cwd: | 292 | if not cwd: |
| @@ -362,6 +363,7 @@ class GitCommand(object): | |||
| 362 | "ReturnCode": str(e.git_rc) | 363 | "ReturnCode": str(e.git_rc) |
| 363 | if e.git_rc is not None | 364 | if e.git_rc is not None |
| 364 | else None, | 365 | else None, |
| 366 | "IsError": log_as_error, | ||
| 365 | } | 367 | } |
| 366 | ) | 368 | ) |
| 367 | event_log.ErrorEvent( | 369 | event_log.ErrorEvent( |
