Сценарий: Попытка клонировать защищенное хранилище Github.
Я проверил код в своем личном репозитории bitbucket, содержащем тестовую строку текста.- оно работает.
Однако, при попытке использовать тот же код для GitHub-хранилища компании, я получаю следующую ошибку через консоль:
Cloning into '/Users/frelee/documents/KonyIntegrationBuild'...
2019-04-15 10:44:05.441475-0700 git-remote-https[6504:56517] nw_path_close_fd Failed to close guarded necp fd 3 [9: Bad file descriptor]
2019-04-15 10:44:05.670364-0700 git-remote-https[6506:56594] nw_path_close_fd Failed to close guarded necp fd 3 [9: Bad file descriptor]
2019-04-15 10:44:05.700772-0700 git-credential-osxkeychain[6507:56598] [logging-persist] cannot open file at line 42263 of [95fbac39ba]
Вот мой код:
import Foundation
//func cloneRepository() {
// let source = "https://AmourineTech@bitbucket.org/AmourineTech/testbit.git"
// let localTarget:NSString = "~/documents/KonyIntegrationBuild"
// let myPath = localTarget.expandingTildeInPath as String
//
// try! Process().clone(repo: source, path: myPath)
//}
func cloneRepository() {
let nativeSource = "https://github.com/EastWestBank/Native-Mobile-App.git"
let localTarget:NSString = "~/documents/KonyIntegrationBuild"
let myPath = localTarget.expandingTildeInPath as String
try! Process().clone(repo: nativeSource, path: myPath)
}
extension Process {
private static let gitExecURL = URL(fileURLWithPath: "/usr/bin/git")
private static let tarExecURL = URL(fileURLWithPath: "/usr/bin/tar")
public func zip(source: String, archivedOutput: String) throws {
executableURL = Process.tarExecURL
arguments = ["-cf", archivedOutput, source]
// emulate this: $~/workarea:tar -cf MyStuff.zip MyStuff
try run()
}
public func clone(repo: String, path: String) throws {
executableURL = Process.gitExecURL
arguments = ["clone", repo, path]
try run()
}
}
Что означает следующее?
2019-04-15 10:44:05.441475-0700 git-remote-https[6504:56517] nw_path_close_fd Failed to close guarded necp fd 3 [9: Bad file descriptor]
2019-04-15 10:44:05.670364-0700 git-remote-https[6506:56594] nw_path_close_fd Failed to close guarded necp fd 3 [9: Bad file descriptor]
2019-04-15 10:44:05.700772-0700 git-credential-osxkeychain[6507:56598] [logging-persist] cannot open file at line 42263 of [95fbac39ba]
Кстати: я также получаю через консоль следующее:
2019-04-15 10:44:05.700789-0700 git-credential-osxkeychain[6507:56598] [logging-persist] os_unix.c:42263: (0) open(/var/db/DetachedSignatures) - Undefined error: 0
2019-04-15 10:44:05.735647-0700 git-remote-https[6508:56602] nw_path_close_fd Failed to close guarded necp fd 3 [9: Bad file descriptor]
remote: Enumerating objects: 275, done.
remote: Counting objects: 0% (1/275)
remote: Counting objects: 1% (3/275)
remote: Counting objects: 2% (6/275)
remote: Counting objects: 3% (9/275)
remote: Counting objects: 4% (11/275)
...