mirror of
https://github.com/gosticks/SwiftGit2.git
synced 2025-10-16 11:55:34 +00:00
[Lint] Clean up indentation
This commit is contained in:
parent
31a755dd49
commit
0a1a5d4174
@ -59,8 +59,8 @@ public class CommitIterator: IteratorProtocol, Sequence {
|
|||||||
var unsafeCommit: OpaquePointer? = nil
|
var unsafeCommit: OpaquePointer? = nil
|
||||||
let lookupGitResult = git_commit_lookup(&unsafeCommit, repo.pointer, &oid)
|
let lookupGitResult = git_commit_lookup(&unsafeCommit, repo.pointer, &oid)
|
||||||
guard lookupGitResult == GIT_OK.rawValue,
|
guard lookupGitResult == GIT_OK.rawValue,
|
||||||
let unwrapCommit = unsafeCommit else {
|
let unwrapCommit = unsafeCommit else {
|
||||||
return Result.failure(NSError(gitError: lookupGitResult, pointOfFailure: "git_commit_lookup"))
|
return Result.failure(NSError(gitError: lookupGitResult, pointOfFailure: "git_commit_lookup"))
|
||||||
}
|
}
|
||||||
let result: Element = Result.success(Commit(unwrapCommit))
|
let result: Element = Result.success(Commit(unwrapCommit))
|
||||||
git_commit_free(unsafeCommit)
|
git_commit_free(unsafeCommit)
|
||||||
|
|||||||
@ -151,24 +151,24 @@ public final class Repository {
|
|||||||
public class func clone(from remoteURL: URL, to localURL: URL, localClone: Bool = false, bare: Bool = false,
|
public class func clone(from remoteURL: URL, to localURL: URL, localClone: Bool = false, bare: Bool = false,
|
||||||
credentials: Credentials = .default, checkoutStrategy: CheckoutStrategy = .Safe,
|
credentials: Credentials = .default, checkoutStrategy: CheckoutStrategy = .Safe,
|
||||||
checkoutProgress: CheckoutProgressBlock? = nil) -> Result<Repository, NSError> {
|
checkoutProgress: CheckoutProgressBlock? = nil) -> Result<Repository, NSError> {
|
||||||
var options = cloneOptions(
|
var options = cloneOptions(
|
||||||
bare: bare,
|
bare: bare,
|
||||||
localClone: localClone,
|
localClone: localClone,
|
||||||
fetchOptions: fetchOptions(credentials: credentials),
|
fetchOptions: fetchOptions(credentials: credentials),
|
||||||
checkoutOptions: checkoutOptions(strategy: checkoutStrategy, progress: checkoutProgress))
|
checkoutOptions: checkoutOptions(strategy: checkoutStrategy, progress: checkoutProgress))
|
||||||
|
|
||||||
var pointer: OpaquePointer? = nil
|
var pointer: OpaquePointer? = nil
|
||||||
let remoteURLString = (remoteURL as NSURL).isFileReferenceURL() ? remoteURL.path : remoteURL.absoluteString
|
let remoteURLString = (remoteURL as NSURL).isFileReferenceURL() ? remoteURL.path : remoteURL.absoluteString
|
||||||
let result = localURL.withUnsafeFileSystemRepresentation { localPath in
|
let result = localURL.withUnsafeFileSystemRepresentation { localPath in
|
||||||
git_clone(&pointer, remoteURLString, localPath, &options)
|
git_clone(&pointer, remoteURLString, localPath, &options)
|
||||||
}
|
}
|
||||||
|
|
||||||
guard result == GIT_OK.rawValue else {
|
guard result == GIT_OK.rawValue else {
|
||||||
return Result.failure(NSError(gitError: result, pointOfFailure: "git_clone"))
|
return Result.failure(NSError(gitError: result, pointOfFailure: "git_clone"))
|
||||||
}
|
}
|
||||||
|
|
||||||
let repository = Repository(pointer!)
|
let repository = Repository(pointer!)
|
||||||
return Result.success(repository)
|
return Result.success(repository)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Initializers
|
// MARK: - Initializers
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user