Revert "Fix the oid error introduced by the latest ObjectiveGit"

This reverts commit 65e0cfdf1f.
This commit is contained in:
Bob Sun 2018-05-27 15:33:36 -07:00
parent 89a2018e89
commit eabebe1a53

View file

@ -411,8 +411,8 @@ public class PasswordStore {
} }
var commits = [GTCommit]() var commits = [GTCommit]()
let enumerator = try GTEnumerator(repository: storeRepository) let enumerator = try GTEnumerator(repository: storeRepository)
if let oid = try storeRepository.headReference().targetOID { if let sha = try storeRepository.headReference().targetOID.sha {
try enumerator.pushSHA(oid.sha) try enumerator.pushSHA(sha)
} }
for _ in 0 ..< count { for _ in 0 ..< count {
let commit = try enumerator.nextObject(withSuccess: nil) let commit = try enumerator.nextObject(withSuccess: nil)
@ -554,9 +554,7 @@ public class PasswordStore {
let newTree = try storeRepository.index().writeTree() let newTree = try storeRepository.index().writeTree()
let headReference = try storeRepository.headReference() let headReference = try storeRepository.headReference()
let commitEnum = try GTEnumerator(repository: storeRepository) let commitEnum = try GTEnumerator(repository: storeRepository)
if let oid = headReference.targetOID { try commitEnum.pushSHA(headReference.targetOID.sha!)
try commitEnum.pushSHA(oid.sha)
}
let parent = commitEnum.nextObject() as! GTCommit let parent = commitEnum.nextObject() as! GTCommit
let signature = gitSignatureForNow let signature = gitSignatureForNow
let commit = try storeRepository.createCommit(with: newTree, message: message, author: signature, committer: signature, parents: [parent], updatingReferenceNamed: headReference.name) let commit = try storeRepository.createCommit(with: newTree, message: message, author: signature, committer: signature, parents: [parent], updatingReferenceNamed: headReference.name)