mirror of
https://github.com/gosticks/SwiftGit2.git
synced 2025-10-16 11:55:34 +00:00
Remove unnecessary failure mapping
This commit is contained in:
parent
9becf1cab0
commit
71e9b51a52
@ -867,11 +867,7 @@ public final class Repository {
|
|||||||
private func safeTreeForCommitId(_ oid: OID) -> Result<Tree, NSError> {
|
private func safeTreeForCommitId(_ oid: OID) -> Result<Tree, NSError> {
|
||||||
return withGitObject(oid, type: GIT_OBJ_COMMIT) { commit in
|
return withGitObject(oid, type: GIT_OBJ_COMMIT) { commit in
|
||||||
let treeId = git_commit_tree_id(commit)
|
let treeId = git_commit_tree_id(commit)
|
||||||
let tree = self.tree(OID(treeId!.pointee))
|
return tree(OID(treeId!.pointee))
|
||||||
guard tree.error == nil else {
|
|
||||||
return .failure(tree.error!)
|
|
||||||
}
|
|
||||||
return tree
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user