mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-29 07:52:19 +03:00
Fix filtering of staged statuses
This commit is contained in:
parent
b338ffe8d8
commit
a3a9d024ba
@ -101,18 +101,17 @@ impl GitRepository for LibGitRepository {
|
|||||||
let mut options = git2::StatusOptions::new();
|
let mut options = git2::StatusOptions::new();
|
||||||
options.pathspec(path_prefix);
|
options.pathspec(path_prefix);
|
||||||
options.disable_pathspec_match(true);
|
options.disable_pathspec_match(true);
|
||||||
|
options.show(StatusShow::Index);
|
||||||
|
|
||||||
if let Some(statuses) = self.statuses(Some(&mut options)).log_err() {
|
if let Some(statuses) = self.statuses(Some(&mut options)).log_err() {
|
||||||
for status in statuses
|
for status in statuses.iter() {
|
||||||
.iter()
|
|
||||||
.filter(|status| !status.status().contains(git2::Status::IGNORED))
|
|
||||||
{
|
|
||||||
let path = RepoPath(PathBuf::from(OsStr::from_bytes(status.path_bytes())));
|
let path = RepoPath(PathBuf::from(OsStr::from_bytes(status.path_bytes())));
|
||||||
let Some(status) = read_status(status.status()) else {
|
let status = status.status();
|
||||||
continue
|
if !status.contains(git2::Status::IGNORED) {
|
||||||
};
|
if let Some(status) = read_status(status) {
|
||||||
|
map.insert(path, status)
|
||||||
map.insert(path, status)
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
map
|
map
|
||||||
|
Loading…
Reference in New Issue
Block a user