Git improvements (#24238)
- **Base diffs on uncommitted changes** - **Show added files in project diff view** - **Fix git panel optimism** Release Notes: - Git: update diffs to be relative to HEAD instead of the index; to pave the way for showing which hunks are staged --------- Co-authored-by: Cole <cole@zed.dev>
This commit is contained in:
parent
22b7042b9e
commit
0963401a8d
11 changed files with 241 additions and 231 deletions
|
@ -1285,7 +1285,7 @@ impl Editor {
|
|||
|
||||
let mut code_action_providers = Vec::new();
|
||||
if let Some(project) = project.clone() {
|
||||
get_unstaged_changes_for_buffers(
|
||||
get_uncommitted_changes_for_buffer(
|
||||
&project,
|
||||
buffer.read(cx).all_buffers(),
|
||||
buffer.clone(),
|
||||
|
@ -13657,7 +13657,7 @@ impl Editor {
|
|||
let buffer_id = buffer.read(cx).remote_id();
|
||||
if self.buffer.read(cx).change_set_for(buffer_id).is_none() {
|
||||
if let Some(project) = &self.project {
|
||||
get_unstaged_changes_for_buffers(
|
||||
get_uncommitted_changes_for_buffer(
|
||||
project,
|
||||
[buffer.clone()],
|
||||
self.buffer.clone(),
|
||||
|
@ -14413,7 +14413,7 @@ impl Editor {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_unstaged_changes_for_buffers(
|
||||
fn get_uncommitted_changes_for_buffer(
|
||||
project: &Entity<Project>,
|
||||
buffers: impl IntoIterator<Item = Entity<Buffer>>,
|
||||
buffer: Entity<MultiBuffer>,
|
||||
|
@ -14422,7 +14422,7 @@ fn get_unstaged_changes_for_buffers(
|
|||
let mut tasks = Vec::new();
|
||||
project.update(cx, |project, cx| {
|
||||
for buffer in buffers {
|
||||
tasks.push(project.open_unstaged_changes(buffer.clone(), cx))
|
||||
tasks.push(project.open_uncommitted_changes(buffer.clone(), cx))
|
||||
}
|
||||
});
|
||||
cx.spawn(|mut cx| async move {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue