Skip to content

Commit

Permalink
Merge pull request SwiftGit2#82 from SwiftGit2/swift3-readme
Browse files Browse the repository at this point in the history
Update README.md for Swift 3
  • Loading branch information
mdiep authored Jan 7, 2017
2 parents 36f934d + 2e7a0ce commit 4864cc4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# SwiftGit2 [![Build Status](https://travis-ci.org/SwiftGit2/SwiftGit2.svg)](https://travis-ci.org/SwiftGit2/SwiftGit2)
# SwiftGit2
[![Build Status](https://travis-ci.org/SwiftGit2/SwiftGit2.svg)](https://travis-ci.org/SwiftGit2/SwiftGit2) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](#carthage) [![GitHub release](https://img.shields.io/github/release/ReactiveCocoa/ReactiveSwift.svg)](https://github.com/ReactiveCocoa/ReactiveSwift/releases) ![Swift 3.0.x](https://img.shields.io/badge/Swift-3.0.x-orange.svg)

Swift bindings to [libgit2](https://github.com/libgit2/libgit2).

```swift
let URL: NSURL = ...
let repo = Repository.atURL(URL)
let repo = Repository.at(URL)
if let repo = repo.value {
let latestCommit: Result<Commit, NSError> = repo
.HEAD()
.flatMap { repo.commitWithOID($0.oid) }
.flatMap { repo.commit($0.oid) }
if let commit = latestCommit.value {
print("Latest Commit: \(commit.message) by \(commit.author.name)")
} else {
Expand All @@ -18,8 +20,6 @@ if let repo = repo.value {
}
```

SwiftGit2 requires Xcode 6.3 or later.

## Design
SwiftGit2 uses value objects wherever possible. That means using Swift’s `struct`s and `enum`s without holding references to libgit2 objects. This has a number of advantages:

Expand Down

0 comments on commit 4864cc4

Please sign in to comment.