Skip to content

Commit 8c9baa6

Browse files
committed
[RR] Fix up potential index exception
1 parent c4ded0c commit 8c9baa6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

rolling-release-update.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,13 @@ def check_for_fips_protected_changes(repo, branch, common_tag):
435435

436436
# Print remaining commits including the current failed one
437437
remaining_commits = list(reversed(rolling_commit_map.items()))
438-
start_idx = remaining_commits.index((ciq_commit, upstream_commit))
438+
try:
439+
start_idx = remaining_commits.index((ciq_commit, upstream_commit))
440+
except ValueError:
441+
print("[rolling release update] ERROR: Current commit not found in remaining commits list.")
442+
print("[rolling release update] This may indicate an internal error or unexpected state.")
443+
print("[rolling release update] Aborting.")
444+
exit(1)
439445

440446
for remaining_commit, remaining_upstream in remaining_commits[start_idx:]:
441447
short_sha = repo.git.rev_parse("--short", remaining_commit)

0 commit comments

Comments
 (0)