diff --git a/crates/git/src/repository.rs b/crates/git/src/repository.rs index 03b29eb4a7a28ddc13bdbfb23422f98baa82ae36..bd41f01512df717ccdc866c0719108a73454a766 100644 --- a/crates/git/src/repository.rs +++ b/crates/git/src/repository.rs @@ -1418,17 +1418,18 @@ impl GitRepository for RealGitRepository { .remote_url("upstream") .or_else(|| self.remote_url("origin")); - async move { - crate::blame::Blame::for_path( - &git_binary_path, - &working_directory?, - &path, - &content, - remote_url, - ) - .await - } - .boxed() + self.executor + .spawn(async move { + crate::blame::Blame::for_path( + &git_binary_path, + &working_directory?, + &path, + &content, + remote_url, + ) + .await + }) + .boxed() } fn diff(&self, diff: DiffType) -> BoxFuture<'_, Result> { @@ -1646,6 +1647,8 @@ impl GitRepository for RealGitRepository { let working_directory = self.working_directory(); let git_binary_path = self.any_git_binary_path.clone(); let executor = self.executor.clone(); + // Note: Do not spawn this command on the background thread, it might pop open the credential helper + // which we want to block on. async move { let mut cmd = new_smol_command(git_binary_path); cmd.current_dir(&working_directory?) @@ -1688,6 +1691,8 @@ impl GitRepository for RealGitRepository { let working_directory = self.working_directory(); let executor = cx.background_executor().clone(); let git_binary_path = self.system_git_binary_path.clone(); + // Note: Do not spawn this command on the background thread, it might pop open the credential helper + // which we want to block on. async move { let git_binary_path = git_binary_path.context("git not found on $PATH, can't push")?; let working_directory = working_directory?; @@ -1723,6 +1728,8 @@ impl GitRepository for RealGitRepository { let working_directory = self.working_directory(); let executor = cx.background_executor().clone(); let git_binary_path = self.system_git_binary_path.clone(); + // Note: Do not spawn this command on the background thread, it might pop open the credential helper + // which we want to block on. async move { let git_binary_path = git_binary_path.context("git not found on $PATH, can't pull")?; let mut command = new_smol_command(git_binary_path); @@ -1757,6 +1764,8 @@ impl GitRepository for RealGitRepository { let remote_name = format!("{}", fetch_options); let git_binary_path = self.system_git_binary_path.clone(); let executor = cx.background_executor().clone(); + // Note: Do not spawn this command on the background thread, it might pop open the credential helper + // which we want to block on. async move { let git_binary_path = git_binary_path.context("git not found on $PATH, can't fetch")?; let mut command = new_smol_command(git_binary_path);