mirror of
https://github.com/gitui-org/gitui
synced 2026-05-24 01:18:21 +00:00
parent
fa7cd37ca7
commit
3c8eb7e049
2 changed files with 11 additions and 13 deletions
|
|
@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Fixed
|
||||
- honor options (for untracked files) in `stage_all` command ([#933](https://github.com/extrawurst/gitui/issues/933))
|
||||
- improved file diff speed dramatically ([#976](https://github.com/extrawurst/gitui/issues/976))
|
||||
|
||||
## [0.18] - 2021-10-11
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use super::{stash::is_stash_commit, utils::repo, CommitId};
|
|||
use crate::{
|
||||
error::Error, error::Result, StatusItem, StatusItemType,
|
||||
};
|
||||
use git2::{Diff, DiffDelta, DiffOptions, Repository};
|
||||
use git2::{Diff, DiffOptions, Repository};
|
||||
use scopetime::scope_time;
|
||||
|
||||
/// get all files that are part of a commit
|
||||
|
|
@ -23,24 +23,21 @@ pub fn get_commit_files(
|
|||
get_commit_diff(&repo, id, None)?
|
||||
};
|
||||
|
||||
let mut res = Vec::new();
|
||||
let res = diff
|
||||
.deltas()
|
||||
.map(|delta| {
|
||||
let status = StatusItemType::from(delta.status());
|
||||
|
||||
diff.foreach(
|
||||
&mut |delta: DiffDelta<'_>, _progress| {
|
||||
res.push(StatusItem {
|
||||
StatusItem {
|
||||
path: delta
|
||||
.new_file()
|
||||
.path()
|
||||
.map(|p| p.to_str().unwrap_or("").to_string())
|
||||
.unwrap_or_default(),
|
||||
status: StatusItemType::from(delta.status()),
|
||||
});
|
||||
true
|
||||
},
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
)?;
|
||||
status,
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
Ok(res)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue