mirror of
https://github.com/gosticks/SwiftGit2.git
synced 2025-10-16 11:55:34 +00:00
On second thought, I believe StatusEntry should not be a sub struct of Diff since it has references to two Diff Deltas but itself is not a Diff and not used by anything contained within Diff. It is conceptually different.
This commit is contained in:
parent
3b9beac923
commit
5f4043bb0e
@ -7,6 +7,12 @@
|
||||
//
|
||||
import libgit2
|
||||
|
||||
public struct StatusEntry {
|
||||
public var status: Diff.Status
|
||||
public var headToIndex: Diff.Delta?
|
||||
public var indexToWorkDir: Diff.Delta?
|
||||
}
|
||||
|
||||
public struct Diff {
|
||||
public struct File {
|
||||
public var oid: OID
|
||||
@ -23,12 +29,6 @@ public struct Diff {
|
||||
}
|
||||
}
|
||||
|
||||
public struct StatusEntry {
|
||||
public var status: Status
|
||||
public var headToIndex: Delta?
|
||||
public var indexToWorkDir: Delta?
|
||||
}
|
||||
|
||||
public struct Status: OptionSet {
|
||||
// This appears to be necessary due to bug in Swift
|
||||
// https://bugs.swift.org/browse/SR-3003
|
||||
|
||||
@ -662,8 +662,7 @@ final public class Repository {
|
||||
|
||||
// MARK: - Status
|
||||
|
||||
public func status() -> Result<[Diff.StatusEntry], NSError> {
|
||||
typealias StatusEntry = Diff.StatusEntry
|
||||
public func status() -> Result<[StatusEntry], NSError> {
|
||||
var returnArray = [StatusEntry]()
|
||||
|
||||
// Do this because GIT_STATUS_OPTIONS_INIT is unavailable in swift
|
||||
@ -702,7 +701,7 @@ final public class Repository {
|
||||
indexToWorkDir = Diff.Delta(from: itow.pointee)
|
||||
}
|
||||
|
||||
let statusEntry = Diff.StatusEntry(status: status, headToIndex: headToIndex, indexToWorkDir: indexToWorkDir)
|
||||
let statusEntry = StatusEntry(status: status, headToIndex: headToIndex, indexToWorkDir: indexToWorkDir)
|
||||
returnArray.append(statusEntry)
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user