diff options
| author | Peter Collingbourne <pcc@google.com> | 2024-02-23 19:18:57 -0800 |
|---|---|---|
| committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-02-26 17:51:11 +0000 |
| commit | 97ca50f5f946c39e8ecd00c7e6ea78e90b4bb6dd (patch) | |
| tree | e6daed0271a8142d85bbe8d8a5ac14d8325018f2 | |
| parent | 8896b68926b660a90f37a9a37221c30514c52523 (diff) | |
| download | git-repo-97ca50f5f946c39e8ecd00c7e6ea78e90b4bb6dd.tar.gz | |
git_command: Return None from GetEventTargetPath() if set to empty string
If trace2.eventTarget was set to the empty string,
match git behavior and don't write a trace.
Bug: 319673783
Change-Id: I02b3884ad97551f8a9d7363c2cbe6b0adee6f73e
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/410518
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Tested-by: Peter Collingbourne <pcc@google.com>
| -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 3c3869a2..09ed1a79 100644 --- a/git_command.py +++ b/git_command.py | |||
| @@ -135,6 +135,8 @@ def GetEventTargetPath(): | |||
| 135 | if retval == 0: | 135 | if retval == 0: |
| 136 | # Strip trailing carriage-return in path. | 136 | # Strip trailing carriage-return in path. |
| 137 | path = p.stdout.rstrip("\n") | 137 | path = p.stdout.rstrip("\n") |
| 138 | if path == "": | ||
| 139 | return None | ||
| 138 | elif retval != 1: | 140 | elif retval != 1: |
| 139 | # `git config --get` is documented to produce an exit status of `1` | 141 | # `git config --get` is documented to produce an exit status of `1` |
| 140 | # if the requested variable is not present in the configuration. | 142 | # if the requested variable is not present in the configuration. |
