Skip to content

Commit

Permalink
Convert parameter and property names to camel case, per API guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrubin committed Dec 19, 2016
1 parent 21ee7a4 commit ca028a4
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ disabled_rules:
- function_body_length
- line_length
- type_body_length
- variable_name

opt_in_rules:
- closure_spacing
2 changes: 1 addition & 1 deletion SwiftGit2/CheckoutStrategy.swift
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ public struct CheckoutStrategy: OptionSet {
return value
}

public var git_checkout_strategy: git_checkout_strategy_t {
public var gitCheckoutStrategy: git_checkout_strategy_t {
return git_checkout_strategy_t(UInt32(self.value))
}

8 changes: 4 additions & 4 deletions SwiftGit2/Repository.swift
Original file line number Diff line number Diff line change
@@ -14,17 +14,17 @@ public typealias CheckoutProgressBlock = (String?, Int, Int) -> Void

/// Helper function used as the libgit2 progress callback in git_checkout_options.
/// This is a function with a type signature of git_checkout_progress_cb.
private func checkoutProgressCallback(path: UnsafePointer<Int8>?, completed_steps: Int, total_steps: Int, payload: UnsafeMutableRawPointer?) -> Void {
private func checkoutProgressCallback(path: UnsafePointer<Int8>?, completedSteps: Int, totalSteps: Int, payload: UnsafeMutableRawPointer?) -> Void {
if let payload = payload {
let buffer = payload.assumingMemoryBound(to: CheckoutProgressBlock.self)
let block: CheckoutProgressBlock
if completed_steps < total_steps {
if completedSteps < totalSteps {
block = buffer.pointee
} else {
block = buffer.move()
buffer.deallocate(capacity: 1)
}
block(path.flatMap(String.init(validatingUTF8:)), completed_steps, total_steps)
block(path.flatMap(String.init(validatingUTF8:)), completedSteps, totalSteps)
}
}

@@ -40,7 +40,7 @@ private func checkoutOptions(strategy: CheckoutStrategy, progress: CheckoutProgr
var options = pointer.move()
pointer.deallocate(capacity: 1)

options.checkout_strategy = strategy.git_checkout_strategy.rawValue
options.checkout_strategy = strategy.gitCheckoutStrategy.rawValue

if progress != nil {
options.progress_cb = checkoutProgressCallback

0 comments on commit ca028a4

Please sign in to comment.