Updated to Swift 5.2

This commit is contained in:
Bilal Reffas 2020-04-27 22:05:20 +02:00
parent c5cbf4cc17
commit 5ec4722a20
4 changed files with 14 additions and 5 deletions

View File

@ -1,7 +1,7 @@
language: objective-c
os: osx
osx_image: xcode10.2
osx_image: xcode11.4
sudo: false # Enable container-based builds

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -94,7 +94,7 @@ public struct Diff {
}
public let rawValue: UInt32
public static let binary = Flags(rawValue: 0)
public static let binary = Flags([])
public static let notBinary = Flags(rawValue: 1 << 0)
public static let validId = Flags(rawValue: 1 << 1)
public static let exists = Flags(rawValue: 1 << 2)

View File

@ -588,9 +588,10 @@ public final class Repository {
/// Stage the file(s) under the specified path.
public func add(path: String) -> Result<(), NSError> {
let dir = path
var dirPointer = UnsafeMutablePointer<Int8>(mutating: (dir as NSString).utf8String)
var paths = git_strarray(strings: &dirPointer, count: 1)
var dirPointer = UnsafeMutablePointer<Int8>(mutating: (path as NSString).utf8String)
var paths = withExtendedLifetime(&dirPointer) {
git_strarray(strings: $0, count: 1)
}
return unsafeIndex().flatMap { index in
defer { git_index_free(index) }
let addResult = git_index_add_all(index, &paths, 0, nil, nil)