Skip to content

Commit

Permalink
Repository isn't needed for a Client.init extension
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesyo committed May 25, 2017
1 parent 3b56091 commit 7f7efb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/CarthageKit/GitHub.swift
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private func tokenFromEnvironment(forServer server: Server) -> String? {
}

extension Client {
convenience init(server: Server, repository: Repository, isAuthenticated: Bool = true) {
convenience init(server: Server, isAuthenticated: Bool = true) {
if Client.userAgent == nil {
Client.userAgent = gitHubUserAgent()
}
Expand Down
4 changes: 2 additions & 2 deletions Source/CarthageKit/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -584,13 +584,13 @@ public final class Project {

switch dependency {
case let .gitHub(server, repository):
let client = Client(server: server, repository: repository)
let client = Client(server: server)
return self.downloadMatchingBinaries(for: dependency, atRevision: revision, fromRepository: repository, client: client)
.flatMapError { error -> SignalProducer<URL, CarthageError> in
if !client.isAuthenticated {
return SignalProducer(error: error)
}
return self.downloadMatchingBinaries(for: dependency, atRevision: revision, fromRepository: repository, client: Client(server: server, repository: repository, isAuthenticated: false))
return self.downloadMatchingBinaries(for: dependency, atRevision: revision, fromRepository: repository, client: Client(server: server, isAuthenticated: false))
}
.flatMap(.concat) { self.unarchiveAndCopyBinaryFrameworks(zipFile: $0, projectName: dependency.name, commitish: revision, toolchain: toolchain) }
.on(completed: {
Expand Down

0 comments on commit 7f7efb7

Please sign in to comment.