Git Panel: separate new and changed (#24181)
Release Notes: - N/A --------- Co-authored-by: conrad <conrad@zed.dev> Co-authored-by: nate <nate@zed.dev>
This commit is contained in:
parent
6659aea13b
commit
71f2cbe798
7 changed files with 666 additions and 589 deletions
|
@ -2,7 +2,6 @@ use anyhow::{anyhow, Context as _, Result};
|
|||
use extension::ExtensionHostProxy;
|
||||
use extension_host::headless_host::HeadlessExtensionStore;
|
||||
use fs::{CreateOptions, Fs};
|
||||
use futures::channel::mpsc;
|
||||
use git::{repository::RepoPath, COMMIT_MESSAGE};
|
||||
use gpui::{App, AppContext as _, AsyncApp, Context, Entity, PromptLevel, SharedString};
|
||||
use http_client::HttpClient;
|
||||
|
@ -637,15 +636,9 @@ impl HeadlessProject {
|
|||
.map(PathBuf::from)
|
||||
.map(RepoPath::new)
|
||||
.collect();
|
||||
let (err_sender, mut err_receiver) = mpsc::channel(1);
|
||||
repository_handle
|
||||
.stage_entries(entries, err_sender)
|
||||
.context("staging entries")?;
|
||||
if let Some(error) = err_receiver.next().await {
|
||||
Err(error.context("error during staging"))
|
||||
} else {
|
||||
Ok(proto::Ack {})
|
||||
}
|
||||
|
||||
repository_handle.stage_entries(entries).await?;
|
||||
Ok(proto::Ack {})
|
||||
}
|
||||
|
||||
async fn handle_unstage(
|
||||
|
@ -665,15 +658,10 @@ impl HeadlessProject {
|
|||
.map(PathBuf::from)
|
||||
.map(RepoPath::new)
|
||||
.collect();
|
||||
let (err_sender, mut err_receiver) = mpsc::channel(1);
|
||||
repository_handle
|
||||
.unstage_entries(entries, err_sender)
|
||||
.context("unstaging entries")?;
|
||||
if let Some(error) = err_receiver.next().await {
|
||||
Err(error.context("error during unstaging"))
|
||||
} else {
|
||||
Ok(proto::Ack {})
|
||||
}
|
||||
|
||||
repository_handle.unstage_entries(entries).await?;
|
||||
|
||||
Ok(proto::Ack {})
|
||||
}
|
||||
|
||||
async fn handle_commit(
|
||||
|
@ -688,17 +676,9 @@ impl HeadlessProject {
|
|||
|
||||
let name = envelope.payload.name.map(SharedString::from);
|
||||
let email = envelope.payload.email.map(SharedString::from);
|
||||
let (err_sender, mut err_receiver) = mpsc::channel(1);
|
||||
cx.update(|cx| {
|
||||
repository_handle
|
||||
.commit(name.zip(email), err_sender, cx)
|
||||
.context("unstaging entries")
|
||||
})??;
|
||||
if let Some(error) = err_receiver.next().await {
|
||||
Err(error.context("error during unstaging"))
|
||||
} else {
|
||||
Ok(proto::Ack {})
|
||||
}
|
||||
|
||||
repository_handle.commit(name.zip(email)).await?;
|
||||
Ok(proto::Ack {})
|
||||
}
|
||||
|
||||
async fn handle_open_commit_message_buffer(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue