mirror of
https://github.com/gitui-org/gitui
synced 2026-05-23 08:58:21 +00:00
get_commit_diff on commit with unknown parent (#836)
This commit is contained in:
parent
29f71f50d4
commit
71e3d9a9b8
2 changed files with 4 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## Fixed
|
||||
- do not allow to ignore .gitignore files ([#825](https://github.com/extrawurst/gitui/issues/825))
|
||||
- crash in shallow repo ([#836](https://github.com/extrawurst/gitui/issues/836))
|
||||
|
||||
## [0.16.2] - 2021-07-10
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,9 @@ pub(crate) fn get_commit_diff(
|
|||
let commit = repo.find_commit(id.into())?;
|
||||
let commit_tree = commit.tree()?;
|
||||
let parent = if commit.parent_count() > 0 {
|
||||
Some(repo.find_commit(commit.parent_id(0)?)?.tree()?)
|
||||
repo.find_commit(commit.parent_id(0)?)
|
||||
.ok()
|
||||
.and_then(|c| c.tree().ok())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue