From 04e6c29e58ba8b5740e5515c7fa1e216c8152c86 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 15:23:12 +0000 Subject: [PATCH 1/2] Initial plan From ff0ef4faf3851e0d2dd73d8fb748c0ab66c2eb3e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 15:28:42 +0000 Subject: [PATCH 2/2] fix: use wrapper struct for branch TOML deserialization test to properly isolate SerializableBranch Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com> --- src/options.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/options.rs b/src/options.rs index 2ecfd38..58f8fd5 100644 --- a/src/options.rs +++ b/src/options.rs @@ -716,9 +716,15 @@ mod tests { #[test] fn test_branch_deserialize_from_toml_rejects_empty_and_whitespace() { + // Use a wrapper struct because TOML top-level must be a table; + // SerializableBranch appears as a field value in real config files. + #[derive(Debug, serde::Deserialize)] + struct Helper { + branch: SerializableBranch, + } + // Empty string should be rejected - let res_empty: Result = - toml::from_str("branch = \"\""); + let res_empty: Result = toml::from_str(r#"branch = """#); assert!(res_empty.is_err(), "expected error for empty branch value"); let err_empty = res_empty.unwrap_err().to_string(); assert!( @@ -727,8 +733,7 @@ mod tests { ); // Whitespace-only string should be rejected - let res_ws: Result = - toml::from_str("branch = \" \""); + let res_ws: Result = toml::from_str(r#"branch = " ""#); assert!(res_ws.is_err(), "expected error for whitespace-only branch value"); let err_ws = res_ws.unwrap_err().to_string(); assert!(