also should check success of git_status_init_options

This commit is contained in:
Jake Van Alstyne 🎩 2017-09-01 16:45:48 -06:00
parent 42619872f8
commit bf2bc2ed88

View File

@ -677,7 +677,10 @@ final public class Repository {
// Do this because GIT_STATUS_OPTIONS_INIT is unavailable in swift
let pointer = UnsafeMutablePointer<git_status_options>.allocate(capacity: 1)
git_status_init_options(pointer, UInt32(GIT_STATUS_OPTIONS_VERSION))
let optionsResult = git_status_init_options(pointer, UInt32(GIT_STATUS_OPTIONS_VERSION))
guard optionsResult == GIT_OK.rawValue else {
return Result.failure(NSError(gitError: optionsResult, pointOfFailure: "git_status_init_options"))
}
var options = pointer.move()
pointer.deallocate(capacity: 1)