remove debug messages

This commit is contained in:
Bob Sun 2017-02-08 19:20:23 +08:00
parent af68f15947
commit 708a875d9d
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4

View file

@ -27,10 +27,8 @@ struct GitCredential {
let credential: GTCredential? let credential: GTCredential?
switch self.credential { switch self.credential {
case let .http(userName, password): case let .http(userName, password):
print("username \(userName), password \(password)")
credential = try? GTCredential(userName: userName, password: password) credential = try? GTCredential(userName: userName, password: password)
case let .ssh(userName, password, publicKeyFile, privateKeyFile): case let .ssh(userName, password, publicKeyFile, privateKeyFile):
print("username \(userName), password \(password), publicKeyFile \(publicKeyFile), privateKeyFile \(privateKeyFile)")
credential = try? GTCredential(userName: userName, publicKeyURL: publicKeyFile, privateKeyURL: privateKeyFile, passphrase: password) credential = try? GTCredential(userName: userName, publicKeyURL: publicKeyFile, privateKeyURL: privateKeyFile, passphrase: password)
} }
return credential ?? GTCredential() return credential ?? GTCredential()
@ -88,13 +86,11 @@ class PasswordStore {
credential: GitCredential, credential: GitCredential,
transferProgressBlock: @escaping (UnsafePointer<git_transfer_progress>, UnsafeMutablePointer<ObjCBool>) -> Void, transferProgressBlock: @escaping (UnsafePointer<git_transfer_progress>, UnsafeMutablePointer<ObjCBool>) -> Void,
checkoutProgressBlock: @escaping (String?, UInt, UInt) -> Void) throws { checkoutProgressBlock: @escaping (String?, UInt, UInt) -> Void) throws {
print("start cloning...")
let credentialProvider = try credential.credentialProvider() let credentialProvider = try credential.credentialProvider()
let options: [String: Any] = [ let options: [String: Any] = [
GTRepositoryCloneOptionsCredentialProvider: credentialProvider, GTRepositoryCloneOptionsCredentialProvider: credentialProvider,
] ]
storeRepository = try GTRepository.clone(from: remoteRepoURL, toWorkingDirectory: tempStoreURL, options: options, transferProgressBlock:transferProgressBlock, checkoutProgressBlock: checkoutProgressBlock) storeRepository = try GTRepository.clone(from: remoteRepoURL, toWorkingDirectory: tempStoreURL, options: options, transferProgressBlock:transferProgressBlock, checkoutProgressBlock: checkoutProgressBlock)
print("clone finish")
let fm = FileManager.default let fm = FileManager.default
do { do {
if fm.fileExists(atPath: storeURL.path) { if fm.fileExists(atPath: storeURL.path) {
@ -111,8 +107,6 @@ class PasswordStore {
} }
func pullRepository(transferProgressBlock: @escaping (UnsafePointer<git_transfer_progress>, UnsafeMutablePointer<ObjCBool>) -> Void) throws { func pullRepository(transferProgressBlock: @escaping (UnsafePointer<git_transfer_progress>, UnsafeMutablePointer<ObjCBool>) -> Void) throws {
print("pullRepoisitory")
print("start pulling...")
let credentialProvider = try gitCredential!.credentialProvider() let credentialProvider = try gitCredential!.credentialProvider()
let options: [String: Any] = [ let options: [String: Any] = [
GTRepositoryRemoteOptionsCredentialProvider: credentialProvider GTRepositoryRemoteOptionsCredentialProvider: credentialProvider