diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-08-28 18:25:07 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-28 18:25:07 +0300 |
| commit | 095f1337d6502081658973ae3487dee8c6b34e1a (patch) | |
| tree | 4174cac82dd51dabcc1fcef57b45df2462ef1918 /src/app/api/worktrees | |
| parent | 13a9f6402fb77a31499bf758b56ca42b79936706 (diff) | |
fix: trust worktree repositories per request (#3344)
refs #3044
Diffstat (limited to 'src/app/api/worktrees')
| -rw-r--r-- | src/app/api/worktrees/deferred.rs | 15 |
1 files changed, 13 insertions, 2 deletions
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 { |
