mirror of
https://github.com/gosticks/SwiftGit2.git
synced 2025-10-16 11:55:34 +00:00
Fix for spec failing because only the diff for the first parent was calculated.
This commit is contained in:
parent
ecb5263f6b
commit
26f1bb7c86
@ -379,7 +379,7 @@ final public class Repository {
|
||||
let err = NSError(gitError: result, pointOfFailure: "git_remote_fetch")
|
||||
return .failure(err)
|
||||
}
|
||||
return .success()
|
||||
return .success(())
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -573,17 +573,18 @@ final public class Repository {
|
||||
return self.diff(fromTree: nil, toTree: baseTree)
|
||||
}
|
||||
|
||||
let mergeDiff: Result<OpaquePointer?, NSError> = .success(nil)
|
||||
var mergeDiff: Result<OpaquePointer?, NSError> = .success(nil)
|
||||
for parent in commit.parents {
|
||||
print("parent: " + String(parent.hashValue))
|
||||
let diff = self
|
||||
.commit(with: parent.oid)
|
||||
.flatMap { commit in
|
||||
return self.tree(from: commit)
|
||||
.flatMap { parentCommit in
|
||||
return self.tree(from: parentCommit)
|
||||
}
|
||||
.flatMap { tree in
|
||||
return self.diff(fromTree: tree, toTree: baseTree)
|
||||
.flatMap { parentTree in
|
||||
return self.diff(fromTree: parentTree, toTree: baseTree)
|
||||
}
|
||||
return mergeDiff
|
||||
mergeDiff = mergeDiff
|
||||
.fanout(diff)
|
||||
.flatMap { (mergeDiff, diff) in
|
||||
guard let mergeDiff = mergeDiff else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user