Use if-let shape for refresh outcome handling

Switch from match-on-Result to if-let-Err so the refresh outcome and
merge_result outcome are checked independently, making the intent
clearer: 'attempt refresh; on Ok-merge-with-refresh-error propagate;
on Err-merge-with-refresh-error log and surface the original merge
error'. No semantic change — both shapes were valid (wildcard patterns
don't move the scrutinee) — but the if-let form sidesteps a
needs-second-reading question raised in code review.

Co-Authored-By: Ragnor Comerford <ragnor.comerford@gmail.com>
This commit is contained in:
Devin AI 2026-05-11 21:50:26 +00:00
parent 7d1a40102c
commit a6c7e5fab5

View file

@ -1144,17 +1144,15 @@ impl Omnigraph {
// that with a less informative error; the next op or the next
// `Omnigraph::open` will re-sync the coord anyway.
if previous_branch == target_branch {
match merge_result {
Ok(_) => self.refresh_coordinator_only().await?,
Err(_) => {
if let Err(err) = self.refresh_coordinator_only().await {
tracing::warn!(
error = %err,
"post-merge coordinator refresh failed on the error path; \
the next op or open will re-sync"
);
}
if let Err(refresh_err) = self.refresh_coordinator_only().await {
if merge_result.is_ok() {
return Err(refresh_err);
}
tracing::warn!(
error = %refresh_err,
"post-merge coordinator refresh failed on the error path; \
the next op or open will re-sync"
);
}
}