aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-08-28 18:25:07 +0300
committerGitHub <noreply@github.com>2026-08-28 18:25:07 +0300
commit095f1337d6502081658973ae3487dee8c6b34e1a (patch)
tree4174cac82dd51dabcc1fcef57b45df2462ef1918 /src/api
parent13a9f6402fb77a31499bf758b56ca42b79936706 (diff)
fix: trust worktree repositories per request (#3344)
refs #3044
Diffstat (limited to 'src/api')
-rw-r--r--src/api/schema/tests.rs2
-rw-r--r--src/api/schema/worktrees.rs8
2 files changed, 10 insertions, 0 deletions
diff --git a/src/api/schema/tests.rs b/src/api/schema/tests.rs
index 5199038d..663f3fc4 100644
--- a/src/api/schema/tests.rs
+++ b/src/api/schema/tests.rs
@@ -720,10 +720,12 @@ fn worktree_request_and_response_round_trip() {
branch: Some("worktree/api".into()),
base: Some("HEAD".into()),
focus: true,
+ trust_repository: true,
..WorktreeCreateParams::default()
}),
};
let json = serde_json::to_string(&request).unwrap();
+ assert!(json.contains("\"trust_repository\":true"));
let restored: Request = serde_json::from_str(&json).unwrap();
assert_eq!(restored, request);
diff --git a/src/api/schema/worktrees.rs b/src/api/schema/worktrees.rs
index dc35128e..3b0d4b35 100644
--- a/src/api/schema/worktrees.rs
+++ b/src/api/schema/worktrees.rs
@@ -6,6 +6,8 @@ pub struct WorktreeListParams {
pub workspace_id: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub cwd: Option<String>,
+ #[serde(default, skip_serializing_if = "super::is_false")]
+ pub trust_repository: bool,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
@@ -24,6 +26,8 @@ pub struct WorktreeCreateParams {
pub label: Option<String>,
#[serde(default)]
pub focus: bool,
+ #[serde(default, skip_serializing_if = "super::is_false")]
+ pub trust_repository: bool,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default)]
@@ -40,6 +44,8 @@ pub struct WorktreeOpenParams {
pub label: Option<String>,
#[serde(default)]
pub focus: bool,
+ #[serde(default, skip_serializing_if = "super::is_false")]
+ pub trust_repository: bool,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
@@ -47,6 +53,8 @@ pub struct WorktreeRemoveParams {
pub workspace_id: String,
#[serde(default)]
pub force: bool,
+ #[serde(default, skip_serializing_if = "super::is_false")]
+ pub trust_repository: bool,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]