Return error here because something is happening

but not running out of commits
This commit is contained in:
Arnon Keereena 2017-05-04 08:26:31 +02:00
parent 42d92319ef
commit 8088f8b11f

View File

@ -58,7 +58,7 @@ public class CommitIterator: IteratorProtocol {
let lookupGitResult = git_commit_lookup(&unsafeCommit, repo.pointer, &oid)
guard lookupGitResult == GIT_OK.rawValue,
let unwrapCommit = unsafeCommit else {
return nil
return Result.failure(NSError(gitError: lookupGitResult, pointOfFailure: "git_commit_lookup"))
}
let result: Element = Result.success(Commit(unwrapCommit))
git_commit_free(unsafeCommit)