From ac5983056c54ee77d5a9dd7fb62055124ed1ca99 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Sun, 9 Aug 2026 00:55:39 +0800 Subject: [PATCH] style(git): collapse the ahead/behind fallback into one condition --- crates/tty7-core/src/core/git/status.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/tty7-core/src/core/git/status.rs b/crates/tty7-core/src/core/git/status.rs index 2969234b..0e84d4be 100644 --- a/crates/tty7-core/src/core/git/status.rs +++ b/crates/tty7-core/src/core/git/status.rs @@ -822,10 +822,10 @@ pub fn probe_status(host: &dyn Host, cwd: &Path) -> Option { return None; } let mut parsed = parse_porcelain_v2(&out.stdout); - if parsed.ahead_behind.is_none() { - if let Some(upstream) = parsed.upstream.clone() { - parsed.ahead_behind = rev_list_ahead_behind(host, cwd, &upstream); - } + if parsed.ahead_behind.is_none() + && let Some(upstream) = parsed.upstream.clone() + { + parsed.ahead_behind = rev_list_ahead_behind(host, cwd, &upstream); } let listing = host.read_dir(&git_dir, None).unwrap_or_default();