diff options
author | Josip Sokcevic <sokcevic@chromium.org> | 2024-10-30 16:06:08 +0000 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-10-30 16:11:04 +0000 |
commit | e219c78fe595c09c5d5b7023ae59f465a61f46ff (patch) | |
tree | a82b9dbd94b64998492b06bec71f3a9765c20041 | |
parent | f9f4df62e062cccd279867c551a109365b4f380f (diff) | |
download | git-repo-e219c78fe595c09c5d5b7023ae59f465a61f46ff.tar.gz |
forall: Fix returning results early
rc should be returned only after all results are processed.
R=jojwang@google.com
Bug: b/376454189
Change-Id: I8200b9954240dd3e8e9f2ab82494779a3cb38627
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/440901
Tested-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Joanna Wang <jojwang@google.com>
-rw-r--r-- | subcmds/forall.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/subcmds/forall.py b/subcmds/forall.py index e5fc9e80..9da0c96e 100644 --- a/subcmds/forall.py +++ b/subcmds/forall.py | |||
@@ -279,7 +279,7 @@ without iterating through the remaining projects. | |||
279 | rc = rc or r | 279 | rc = rc or r |
280 | if r != 0 and opt.abort_on_errors: | 280 | if r != 0 and opt.abort_on_errors: |
281 | raise Exception("Aborting due to previous error") | 281 | raise Exception("Aborting due to previous error") |
282 | return rc | 282 | return rc |
283 | 283 | ||
284 | try: | 284 | try: |
285 | config = self.manifest.manifestProject.config | 285 | config = self.manifest.manifestProject.config |
@@ -298,7 +298,7 @@ without iterating through the remaining projects. | |||
298 | ) | 298 | ) |
299 | except (KeyboardInterrupt, WorkerKeyboardInterrupt): | 299 | except (KeyboardInterrupt, WorkerKeyboardInterrupt): |
300 | # Catch KeyboardInterrupt raised inside and outside of workers | 300 | # Catch KeyboardInterrupt raised inside and outside of workers |
301 | rc = rc or errno.EINTR | 301 | rc = errno.EINTR |
302 | except Exception as e: | 302 | except Exception as e: |
303 | # Catch any other exceptions raised | 303 | # Catch any other exceptions raised |
304 | logger.error( | 304 | logger.error( |
@@ -306,7 +306,7 @@ without iterating through the remaining projects. | |||
306 | type(e).__name__, | 306 | type(e).__name__, |
307 | e, | 307 | e, |
308 | ) | 308 | ) |
309 | rc = rc or getattr(e, "errno", 1) | 309 | rc = getattr(e, "errno", 1) |
310 | if rc != 0: | 310 | if rc != 0: |
311 | sys.exit(rc) | 311 | sys.exit(rc) |
312 | 312 | ||