mirror of
https://github.com/gosticks/SwiftGit2.git
synced 2025-10-16 11:55:34 +00:00
clean up various xcode warnings
This commit is contained in:
parent
a9f79a3b80
commit
db0a955e03
@ -10,11 +10,11 @@ public class CommitIterator: IteratorProtocol, Sequence {
|
||||
public typealias Iterator = CommitIterator
|
||||
public typealias Element = Result<Commit, NSError>
|
||||
let repo: Repository
|
||||
private var revisionWalker: OpaquePointer? = nil
|
||||
private var revisionWalker: OpaquePointer?
|
||||
|
||||
private enum Next {
|
||||
case over
|
||||
case ok
|
||||
case okay
|
||||
case error(NSError)
|
||||
|
||||
init(_ result: Int32, name: String) {
|
||||
@ -22,7 +22,7 @@ public class CommitIterator: IteratorProtocol, Sequence {
|
||||
case GIT_ITEROVER.rawValue:
|
||||
self = .over
|
||||
case GIT_OK.rawValue:
|
||||
self = .ok
|
||||
self = .okay
|
||||
default:
|
||||
self = .error(NSError(gitError: result, pointOfFailure: name))
|
||||
}
|
||||
@ -55,7 +55,7 @@ public class CommitIterator: IteratorProtocol, Sequence {
|
||||
return Result.failure(error)
|
||||
case .over:
|
||||
return nil
|
||||
case .ok:
|
||||
case .okay:
|
||||
var unsafeCommit: OpaquePointer? = nil
|
||||
let lookupGitResult = git_commit_lookup(&unsafeCommit, repo.pointer, &oid)
|
||||
guard lookupGitResult == GIT_OK.rawValue,
|
||||
@ -76,7 +76,7 @@ public class CommitIterator: IteratorProtocol, Sequence {
|
||||
public func map<T>(_ transform: (Result<Commit, NSError>) throws -> T) rethrows -> [T] {
|
||||
var new: [T] = []
|
||||
for item in self {
|
||||
new = new + [try transform(item)]
|
||||
new += [try transform(item)]
|
||||
}
|
||||
return new
|
||||
}
|
||||
@ -85,7 +85,7 @@ public class CommitIterator: IteratorProtocol, Sequence {
|
||||
var new: [Result<Commit, NSError>] = []
|
||||
for item in self {
|
||||
if try isIncluded(item) {
|
||||
new = new + [item]
|
||||
new += [item]
|
||||
}
|
||||
}
|
||||
return new
|
||||
@ -104,12 +104,12 @@ public class CommitIterator: IteratorProtocol, Sequence {
|
||||
self.repo = repo
|
||||
}
|
||||
|
||||
public func dropFirst(_ n: Int) -> AnySequence<Iterator.Element> {
|
||||
public func dropFirst(_ num: Int) -> AnySequence<Iterator.Element> {
|
||||
notImplemented(functionName: self.dropFirst)
|
||||
return AnySequence<Iterator.Element> { return CommitIterator(repo: self.repo) }
|
||||
}
|
||||
|
||||
public func dropLast(_ n: Int) -> AnySequence<Iterator.Element> {
|
||||
public func dropLast(_ num: Int) -> AnySequence<Iterator.Element> {
|
||||
notImplemented(functionName: self.dropLast)
|
||||
return AnySequence<Iterator.Element> { return CommitIterator(repo: self.repo) }
|
||||
}
|
||||
|
||||
@ -49,20 +49,20 @@ public struct Diff {
|
||||
}
|
||||
public let rawValue: UInt32
|
||||
|
||||
public static let current = Status(rawValue: 0)
|
||||
public static let indexNew = Status(rawValue: 1 << 0)
|
||||
public static let indexModified = Status(rawValue: 1 << 1)
|
||||
public static let indexDeleted = Status(rawValue: 1 << 2)
|
||||
public static let indexRenamed = Status(rawValue: 1 << 3)
|
||||
public static let indexTypeChange = Status(rawValue: 1 << 4)
|
||||
public static let workTreeNew = Status(rawValue: 1 << 5)
|
||||
public static let workTreeModified = Status(rawValue: 1 << 6)
|
||||
public static let workTreeDeleted = Status(rawValue: 1 << 7)
|
||||
public static let workTreeTypeChange = Status(rawValue: 1 << 8)
|
||||
public static let workTreeRenamed = Status(rawValue: 1 << 9)
|
||||
public static let workTreeUnreadable = Status(rawValue: 1 << 10)
|
||||
public static let ignored = Status(rawValue: 1 << 11)
|
||||
public static let conflicted = Status(rawValue: 1 << 12)
|
||||
public static let current = Status(rawValue: 0)
|
||||
public static let indexNew = Status(rawValue: 1 << 0)
|
||||
public static let indexModified = Status(rawValue: 1 << 1)
|
||||
public static let indexDeleted = Status(rawValue: 1 << 2)
|
||||
public static let indexRenamed = Status(rawValue: 1 << 3)
|
||||
public static let indexTypeChange = Status(rawValue: 1 << 4)
|
||||
public static let workTreeNew = Status(rawValue: 1 << 5)
|
||||
public static let workTreeModified = Status(rawValue: 1 << 6)
|
||||
public static let workTreeDeleted = Status(rawValue: 1 << 7)
|
||||
public static let workTreeTypeChange = Status(rawValue: 1 << 8)
|
||||
public static let workTreeRenamed = Status(rawValue: 1 << 9)
|
||||
public static let workTreeUnreadable = Status(rawValue: 1 << 10)
|
||||
public static let ignored = Status(rawValue: 1 << 11)
|
||||
public static let conflicted = Status(rawValue: 1 << 12)
|
||||
}
|
||||
|
||||
public struct Flags: OptionSet {
|
||||
|
||||
@ -629,7 +629,7 @@ class RepositorySpec: QuickSpec {
|
||||
"List branches in README\n",
|
||||
"Create a README\n",
|
||||
"List branches in README\n",
|
||||
"Create a README\n"
|
||||
"Create a README\n",
|
||||
]
|
||||
var commitMessages: [String] = []
|
||||
for branch in branches {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user