From a74aac88c95738b1e1c95ac583b116a253920fbf Mon Sep 17 00:00:00 2001 From: Bhuminjay Soni Date: Tue, 2 Dec 2025 16:48:13 +0530 Subject: [PATCH] Increase askpass timeout for git operations (#42946) Closes #29903 Release Notes: - Increased timeout from 17->300 & improved the error message. --------- Signed-off-by: 11happy Signed-off-by: 11happy --- crates/git/src/git.rs | 3 +++ crates/project/src/git_store.rs | 2 ++ crates/proto/proto/git.proto | 1 + 3 files changed, 6 insertions(+) diff --git a/crates/git/src/git.rs b/crates/git/src/git.rs index 8b8f88ef65b86ea9157e1c3217fa01bb0d6355cb..197ce4d6fb3bb3a41dd0be67e542d91d87561736 100644 --- a/crates/git/src/git.rs +++ b/crates/git/src/git.rs @@ -232,12 +232,14 @@ impl From for usize { #[derive(Copy, Clone, Debug)] pub enum RunHook { PreCommit, + PrePush, } impl RunHook { pub fn as_str(&self) -> &str { match self { Self::PreCommit => "pre-commit", + Self::PrePush => "pre-push", } } @@ -248,6 +250,7 @@ impl RunHook { pub fn from_proto(value: i32) -> Option { match value { 0 => Some(Self::PreCommit), + 1 => Some(Self::PrePush), _ => None, } } diff --git a/crates/project/src/git_store.rs b/crates/project/src/git_store.rs index be08ed27440ee1951a166333dccfde9aa173a9f5..58181e20e961685f34c3298add113f847c3d93c5 100644 --- a/crates/project/src/git_store.rs +++ b/crates/project/src/git_store.rs @@ -4648,9 +4648,11 @@ impl Repository { }); let this = cx.weak_entity(); + let rx = self.run_hook(RunHook::PrePush, cx); self.send_job( Some(format!("git push {} {} {}", args, remote, branch).into()), move |git_repo, mut cx| async move { + rx.await??; match git_repo { RepositoryState::Local(LocalRepositoryState { backend, diff --git a/crates/proto/proto/git.proto b/crates/proto/proto/git.proto index 6ef21c2d7a1339b0893b352845d62c432243abf7..de6a5f676df7332d0673d4e5bd75130bf7f0c400 100644 --- a/crates/proto/proto/git.proto +++ b/crates/proto/proto/git.proto @@ -565,6 +565,7 @@ message GitCreateWorktree { message RunGitHook { enum GitHook { PRE_COMMIT = 0; + PRE_PUSH = 1; } uint64 project_id = 1;