mirror of
https://github.com/gosticks/SwiftGit2.git
synced 2025-10-16 11:55:34 +00:00
unsafeSignature -> makeUnsafeSignature()
This commit is contained in:
parent
84d4ae1e33
commit
e6db3c0896
@ -56,7 +56,7 @@ public struct Signature {
|
|||||||
|
|
||||||
/// Return an unsafe pointer to the `git_signature` struct.
|
/// Return an unsafe pointer to the `git_signature` struct.
|
||||||
/// Caller is responsible for freeing it with `git_signature_free`.
|
/// Caller is responsible for freeing it with `git_signature_free`.
|
||||||
var unsafeSignature: Result<UnsafeMutablePointer<git_signature>, NSError> {
|
func makeUnsafeSignature() -> Result<UnsafeMutablePointer<git_signature>, NSError> {
|
||||||
var signature: UnsafeMutablePointer<git_signature>? = nil
|
var signature: UnsafeMutablePointer<git_signature>? = nil
|
||||||
let time = git_time_t(self.time.timeIntervalSince1970) // Unix epoch time
|
let time = git_time_t(self.time.timeIntervalSince1970) // Unix epoch time
|
||||||
let offset: Int32 = Int32(timeZone.secondsFromGMT(for: self.time) / 60)
|
let offset: Int32 = Int32(timeZone.secondsFromGMT(for: self.time) / 60)
|
||||||
|
|||||||
@ -622,7 +622,7 @@ final public class Repository {
|
|||||||
signature: Signature
|
signature: Signature
|
||||||
) -> Result<Commit, NSError> {
|
) -> Result<Commit, NSError> {
|
||||||
// create commit signature
|
// create commit signature
|
||||||
return signature.unsafeSignature.flatMap { signature in
|
return signature.makeUnsafeSignature().flatMap { signature in
|
||||||
defer { git_signature_free(signature) }
|
defer { git_signature_free(signature) }
|
||||||
var tree: OpaquePointer? = nil
|
var tree: OpaquePointer? = nil
|
||||||
var treeOIDCopy = treeOID
|
var treeOIDCopy = treeOID
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user