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
|
@ -265,13 +265,13 @@ impl GitRepository for RealGitRepository {
|
|||
.to_path_buf();
|
||||
|
||||
if !paths.is_empty() {
|
||||
let cmd = new_std_command(&self.git_binary_path)
|
||||
let status = new_std_command(&self.git_binary_path)
|
||||
.current_dir(&working_directory)
|
||||
.args(["update-index", "--add", "--remove", "--"])
|
||||
.args(paths.iter().map(|p| p.as_ref()))
|
||||
.status()?;
|
||||
if !cmd.success() {
|
||||
return Err(anyhow!("Failed to stage paths: {cmd}"));
|
||||
if !status.success() {
|
||||
return Err(anyhow!("Failed to stage paths: {status}"));
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue