If GIT_ASKPASS is already set, assume it will do the right thing (#27681)
Fixes running git push on a coder instance. Closes #ISSUE Release Notes: - Zed will now use `GIT_ASKPASS` if you already have one set instead of overriding with our own. Fixes `git push` in Coder.
This commit is contained in:
parent
4da987dad4
commit
4a5c492188
3 changed files with 61 additions and 44 deletions
|
@ -6,7 +6,7 @@ use crate::{
|
|||
ProjectEnvironment, ProjectItem, ProjectPath,
|
||||
};
|
||||
use anyhow::{anyhow, bail, Context as _, Result};
|
||||
use askpass::{AskPassDelegate, AskPassSession};
|
||||
use askpass::AskPassDelegate;
|
||||
use buffer_diff::{BufferDiff, BufferDiffEvent};
|
||||
use client::ProjectId;
|
||||
use collections::HashMap;
|
||||
|
@ -3098,7 +3098,6 @@ impl Repository {
|
|||
askpass: AskPassDelegate,
|
||||
cx: &mut App,
|
||||
) -> oneshot::Receiver<Result<RemoteCommandOutput>> {
|
||||
let executor = cx.background_executor().clone();
|
||||
let askpass_delegates = self.askpass_delegates.clone();
|
||||
let askpass_id = util::post_inc(&mut self.latest_askpass_id);
|
||||
let env = self.worktree_environment(cx);
|
||||
|
@ -3106,7 +3105,6 @@ impl Repository {
|
|||
self.send_job(move |git_repo, cx| async move {
|
||||
match git_repo {
|
||||
RepositoryState::Local(git_repository) => {
|
||||
let askpass = AskPassSession::new(&executor, askpass).await?;
|
||||
let env = env.await;
|
||||
git_repository.fetch(askpass, env, cx).await
|
||||
}
|
||||
|
@ -3147,7 +3145,6 @@ impl Repository {
|
|||
askpass: AskPassDelegate,
|
||||
cx: &mut App,
|
||||
) -> oneshot::Receiver<Result<RemoteCommandOutput>> {
|
||||
let executor = cx.background_executor().clone();
|
||||
let askpass_delegates = self.askpass_delegates.clone();
|
||||
let askpass_id = util::post_inc(&mut self.latest_askpass_id);
|
||||
let env = self.worktree_environment(cx);
|
||||
|
@ -3156,7 +3153,7 @@ impl Repository {
|
|||
match git_repo {
|
||||
RepositoryState::Local(git_repository) => {
|
||||
let env = env.await;
|
||||
let askpass = AskPassSession::new(&executor, askpass).await?;
|
||||
// let askpass = AskPassSession::new(&executor, askpass).await?;
|
||||
git_repository
|
||||
.push(
|
||||
branch.to_string(),
|
||||
|
@ -3209,7 +3206,6 @@ impl Repository {
|
|||
askpass: AskPassDelegate,
|
||||
cx: &mut App,
|
||||
) -> oneshot::Receiver<Result<RemoteCommandOutput>> {
|
||||
let executor = cx.background_executor().clone();
|
||||
let askpass_delegates = self.askpass_delegates.clone();
|
||||
let askpass_id = util::post_inc(&mut self.latest_askpass_id);
|
||||
let env = self.worktree_environment(cx);
|
||||
|
@ -3217,7 +3213,6 @@ impl Repository {
|
|||
self.send_job(move |git_repo, cx| async move {
|
||||
match git_repo {
|
||||
RepositoryState::Local(git_repository) => {
|
||||
let askpass = AskPassSession::new(&executor, askpass).await?;
|
||||
let env = env.await;
|
||||
git_repository
|
||||
.pull(branch.to_string(), remote.to_string(), askpass, env, cx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue