From 095f1337d6502081658973ae3487dee8c6b34e1a Mon Sep 17 00:00:00 2001 From: Can Celik Date: Fri, 28 Aug 2026 18:25:07 +0300 Subject: fix: trust worktree repositories per request (#3344) refs #3044 --- src/app/api/worktrees/deferred.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/app/api/worktrees') diff --git a/src/app/api/worktrees/deferred.rs b/src/app/api/worktrees/deferred.rs index 3cd5e9f1..4755b38d 100644 --- a/src/app/api/worktrees/deferred.rs +++ b/src/app/api/worktrees/deferred.rs @@ -199,6 +199,7 @@ impl App { &path, &branch, &base, + params.trust_repository, ) }); let _ = event_tx.blocking_send(AppEvent::WorktreeAddFinished(Box::new( @@ -259,7 +260,11 @@ impl App { #[cfg(windows)] { if !params.force - && crate::worktree::checkout_has_dirty_files(&space.checkout_path).unwrap_or(false) + && crate::worktree::checkout_has_dirty_files( + &space.checkout_path, + params.trust_repository, + ) + .unwrap_or(false) { Self::send_api_response( respond_to, @@ -311,6 +316,7 @@ impl App { &space.repo_root, &space.checkout_path, params.force, + params.trust_repository, ); let api_request = ApiWorktreeRemoveRequest { id, @@ -321,10 +327,15 @@ impl App { let repo_root = space.repo_root; let path = space.checkout_path; let force = params.force; + let trust_repository = params.trust_repository; let event_tx = self.event_tx.clone(); std::thread::spawn(move || { let result = crate::worktree::run_worktree_remove_command_with_recovery( - &command, &repo_root, &path, force, + &command, + &repo_root, + &path, + force, + trust_repository, ); let _ = event_tx.blocking_send(AppEvent::WorktreeRemoveFinished(Box::new( crate::events::WorktreeRemoveResult { -- cgit v1.2.3