mirror of
https://github.com/gosticks/SwiftGit2.git
synced 2025-10-16 11:55:34 +00:00
commit
280ab5b473
@ -1,6 +1,7 @@
|
|||||||
language: objective-c
|
language: objective-c
|
||||||
|
|
||||||
osx_image: xcode9.2
|
os: osx
|
||||||
|
osx_image: xcode9.3
|
||||||
|
|
||||||
sudo: false # Enable container-based builds
|
sudo: false # Enable container-based builds
|
||||||
|
|
||||||
|
|||||||
@ -57,6 +57,7 @@
|
|||||||
622726341C84E52500C53D17 /* Credentials.swift in Sources */ = {isa = PBXBuildFile; fileRef = 622726331C84E52500C53D17 /* Credentials.swift */; };
|
622726341C84E52500C53D17 /* Credentials.swift in Sources */ = {isa = PBXBuildFile; fileRef = 622726331C84E52500C53D17 /* Credentials.swift */; };
|
||||||
622726351C84E52500C53D17 /* Credentials.swift in Sources */ = {isa = PBXBuildFile; fileRef = 622726331C84E52500C53D17 /* Credentials.swift */; };
|
622726351C84E52500C53D17 /* Credentials.swift in Sources */ = {isa = PBXBuildFile; fileRef = 622726331C84E52500C53D17 /* Credentials.swift */; };
|
||||||
62E6FD8F1C727E9C00A312B0 /* ZipArchive.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62E6FD8E1C727E9C00A312B0 /* ZipArchive.framework */; };
|
62E6FD8F1C727E9C00A312B0 /* ZipArchive.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62E6FD8E1C727E9C00A312B0 /* ZipArchive.framework */; };
|
||||||
|
8F9A51F2209596A40037C3A6 /* repository-with-status.zip in Resources */ = {isa = PBXBuildFile; fileRef = 237731C61F46542B0020A3FE /* repository-with-status.zip */; };
|
||||||
BE0991F71A578FB1007D4E6A /* Mantle.zip in Resources */ = {isa = PBXBuildFile; fileRef = BE0991F61A578FB1007D4E6A /* Mantle.zip */; };
|
BE0991F71A578FB1007D4E6A /* Mantle.zip in Resources */ = {isa = PBXBuildFile; fileRef = BE0991F61A578FB1007D4E6A /* Mantle.zip */; };
|
||||||
BE0B1C5D1A9978890004726D /* detached-head.zip in Resources */ = {isa = PBXBuildFile; fileRef = BE0B1C5C1A9978890004726D /* detached-head.zip */; };
|
BE0B1C5D1A9978890004726D /* detached-head.zip in Resources */ = {isa = PBXBuildFile; fileRef = BE0B1C5C1A9978890004726D /* detached-head.zip */; };
|
||||||
BE14AA501A1974010015B439 /* SwiftGit2.m in Sources */ = {isa = PBXBuildFile; fileRef = BE14AA4F1A1974010015B439 /* SwiftGit2.m */; };
|
BE14AA501A1974010015B439 /* SwiftGit2.m in Sources */ = {isa = PBXBuildFile; fileRef = BE14AA4F1A1974010015B439 /* SwiftGit2.m */; };
|
||||||
@ -653,6 +654,7 @@
|
|||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
621E66C81C72958D00A0F352 /* detached-head.zip in Resources */,
|
621E66C81C72958D00A0F352 /* detached-head.zip in Resources */,
|
||||||
|
8F9A51F2209596A40037C3A6 /* repository-with-status.zip in Resources */,
|
||||||
621E66C91C72958D00A0F352 /* Mantle.zip in Resources */,
|
621E66C91C72958D00A0F352 /* Mantle.zip in Resources */,
|
||||||
621E66CA1C72958D00A0F352 /* simple-repository.zip in Resources */,
|
621E66CA1C72958D00A0F352 /* simple-repository.zip in Resources */,
|
||||||
);
|
);
|
||||||
|
|||||||
@ -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>
|
||||||
@ -27,12 +27,12 @@ public struct OID {
|
|||||||
let result = git_oid_fromstr(pointer, string)
|
let result = git_oid_fromstr(pointer, string)
|
||||||
|
|
||||||
if result < GIT_OK.rawValue {
|
if result < GIT_OK.rawValue {
|
||||||
pointer.deallocate(capacity: 1)
|
pointer.deallocate()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
oid = pointer.pointee
|
oid = pointer.pointee
|
||||||
pointer.deallocate(capacity: 1)
|
pointer.deallocate()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create an instance from a libgit2 `git_oid`.
|
/// Create an instance from a libgit2 `git_oid`.
|
||||||
|
|||||||
@ -147,7 +147,7 @@ public enum TagReference: ReferenceType {
|
|||||||
|
|
||||||
/// The short human-readable name of the branch (e.g., `master`).
|
/// The short human-readable name of the branch (e.g., `master`).
|
||||||
public var name: String {
|
public var name: String {
|
||||||
return longName.substring(from: "refs/tags/".endIndex)
|
return String(longName["refs/tags/".endIndex...])
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The OID of the target object.
|
/// The OID of the target object.
|
||||||
|
|||||||
@ -23,7 +23,7 @@ private func checkoutProgressCallback(path: UnsafePointer<Int8>?, completedSteps
|
|||||||
block = buffer.pointee
|
block = buffer.pointee
|
||||||
} else {
|
} else {
|
||||||
block = buffer.move()
|
block = buffer.move()
|
||||||
buffer.deallocate(capacity: 1)
|
buffer.deallocate()
|
||||||
}
|
}
|
||||||
block(path.flatMap(String.init(validatingUTF8:)), completedSteps, totalSteps)
|
block(path.flatMap(String.init(validatingUTF8:)), completedSteps, totalSteps)
|
||||||
}
|
}
|
||||||
@ -40,7 +40,7 @@ private func checkoutOptions(strategy: CheckoutStrategy,
|
|||||||
let pointer = UnsafeMutablePointer<git_checkout_options>.allocate(capacity: 1)
|
let pointer = UnsafeMutablePointer<git_checkout_options>.allocate(capacity: 1)
|
||||||
git_checkout_init_options(pointer, UInt32(GIT_CHECKOUT_OPTIONS_VERSION))
|
git_checkout_init_options(pointer, UInt32(GIT_CHECKOUT_OPTIONS_VERSION))
|
||||||
var options = pointer.move()
|
var options = pointer.move()
|
||||||
pointer.deallocate(capacity: 1)
|
pointer.deallocate()
|
||||||
|
|
||||||
options.checkout_strategy = strategy.gitCheckoutStrategy.rawValue
|
options.checkout_strategy = strategy.gitCheckoutStrategy.rawValue
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ private func fetchOptions(credentials: Credentials) -> git_fetch_options {
|
|||||||
|
|
||||||
var options = pointer.move()
|
var options = pointer.move()
|
||||||
|
|
||||||
pointer.deallocate(capacity: 1)
|
pointer.deallocate()
|
||||||
|
|
||||||
options.callbacks.payload = credentials.toPointer()
|
options.callbacks.payload = credentials.toPointer()
|
||||||
options.callbacks.credentials = credentialsCallback
|
options.callbacks.credentials = credentialsCallback
|
||||||
@ -75,7 +75,7 @@ private func cloneOptions(bare: Bool = false, localClone: Bool = false, fetchOpt
|
|||||||
|
|
||||||
var options = pointer.move()
|
var options = pointer.move()
|
||||||
|
|
||||||
pointer.deallocate(capacity: 1)
|
pointer.deallocate()
|
||||||
|
|
||||||
options.bare = bare ? 1 : 0
|
options.bare = bare ? 1 : 0
|
||||||
|
|
||||||
@ -350,7 +350,7 @@ final public class Repository {
|
|||||||
let result = git_remote_list(pointer, self.pointer)
|
let result = git_remote_list(pointer, self.pointer)
|
||||||
|
|
||||||
guard result == GIT_OK.rawValue else {
|
guard result == GIT_OK.rawValue else {
|
||||||
pointer.deallocate(capacity: 1)
|
pointer.deallocate()
|
||||||
return Result.failure(NSError(gitError: result, pointOfFailure: "git_remote_list"))
|
return Result.failure(NSError(gitError: result, pointOfFailure: "git_remote_list"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -359,7 +359,7 @@ final public class Repository {
|
|||||||
return self.remote(named: $0)
|
return self.remote(named: $0)
|
||||||
}
|
}
|
||||||
git_strarray_free(pointer)
|
git_strarray_free(pointer)
|
||||||
pointer.deallocate(capacity: 1)
|
pointer.deallocate()
|
||||||
|
|
||||||
let error = remotes.reduce(nil) { $0 == nil ? $0 : $1.error }
|
let error = remotes.reduce(nil) { $0 == nil ? $0 : $1.error }
|
||||||
if let error = error {
|
if let error = error {
|
||||||
@ -416,7 +416,7 @@ final public class Repository {
|
|||||||
let result = git_reference_list(pointer, self.pointer)
|
let result = git_reference_list(pointer, self.pointer)
|
||||||
|
|
||||||
guard result == GIT_OK.rawValue else {
|
guard result == GIT_OK.rawValue else {
|
||||||
pointer.deallocate(capacity: 1)
|
pointer.deallocate()
|
||||||
return Result.failure(NSError(gitError: result, pointOfFailure: "git_reference_list"))
|
return Result.failure(NSError(gitError: result, pointOfFailure: "git_reference_list"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -429,7 +429,7 @@ final public class Repository {
|
|||||||
self.reference(named: $0)
|
self.reference(named: $0)
|
||||||
}
|
}
|
||||||
git_strarray_free(pointer)
|
git_strarray_free(pointer)
|
||||||
pointer.deallocate(capacity: 1)
|
pointer.deallocate()
|
||||||
|
|
||||||
let error = references.reduce(nil) { $0 == nil ? $0 : $1.error }
|
let error = references.reduce(nil) { $0 == nil ? $0 : $1.error }
|
||||||
if let error = error {
|
if let error = error {
|
||||||
@ -790,7 +790,7 @@ final public class Repository {
|
|||||||
return .failure(NSError(gitError: optionsResult, pointOfFailure: "git_status_init_options"))
|
return .failure(NSError(gitError: optionsResult, pointOfFailure: "git_status_init_options"))
|
||||||
}
|
}
|
||||||
var options = pointer.move()
|
var options = pointer.move()
|
||||||
pointer.deallocate(capacity: 1)
|
pointer.deallocate()
|
||||||
|
|
||||||
var unsafeStatus: OpaquePointer? = nil
|
var unsafeStatus: OpaquePointer? = nil
|
||||||
defer { git_status_list_free(unsafeStatus) }
|
defer { git_status_list_free(unsafeStatus) }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user