From c9332f707d59e63aad873cd78467299823779bd2 Mon Sep 17 00:00:00 2001 From: DuProcess <273172371+DuProcess@users.noreply.github.com> Date: Sun, 12 Jul 2026 21:25:42 -0400 Subject: [PATCH] Clarify update check when local is newer --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/bin/dosh-client.rs | 11 +++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2e10890..b34210f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -436,7 +436,7 @@ dependencies = [ [[package]] name = "dosh" -version = "1.0.0-rc40" +version = "1.0.0-rc41" dependencies = [ "anyhow", "base64", diff --git a/Cargo.toml b/Cargo.toml index 4df473f..9e766e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dosh" -version = "1.0.0-rc40" +version = "1.0.0-rc41" edition = "2024" license = "MIT" diff --git a/src/bin/dosh-client.rs b/src/bin/dosh-client.rs index 287b750..2d5d516 100644 --- a/src/bin/dosh-client.rs +++ b/src/bin/dosh-client.rs @@ -4120,7 +4120,7 @@ fn update_version_status(local: &str, latest: &str) -> &'static str { match compare_dotted_versions(latest, local) { std::cmp::Ordering::Equal => "current", std::cmp::Ordering::Greater => "update available", - std::cmp::Ordering::Less => "different", + std::cmp::Ordering::Less => "local newer than latest release", } } @@ -11222,7 +11222,14 @@ mod tests { fn update_version_status_compares_numeric_parts() { assert_eq!(update_version_status("0.1.5", "0.1.5"), "current"); assert_eq!(update_version_status("0.1.9", "0.1.10"), "update available"); - assert_eq!(update_version_status("1.0.0", "0.9.9"), "different"); + assert_eq!( + update_version_status("1.0.0", "0.9.9"), + "local newer than latest release" + ); + assert_eq!( + update_version_status("1.0.0-rc40", "1.0.0-rc37"), + "local newer than latest release" + ); } #[test]