File tree 1 file changed +15
-15
lines changed
1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -9,24 +9,24 @@ Swift bindings to [libgit2](https://github.com/libgit2/libgit2).
9
9
``` swift
10
10
let URL: URL = ...
11
11
let result = Repository.at (URL)
12
-
13
12
switch result {
14
- case .success (let repo):
15
-
13
+ case let .success (repo):
16
14
let latestCommit = repo
17
15
.HEAD ()
18
- .flatMap { repo.commit ($0 .oid ) }
19
-
20
- switch latestCommit {
21
- case .success (let commit):
22
- print (" Latest Commit: \( commit.message ) by \( commit.author .name ) " )
23
-
24
- case .failure (let error):
25
- print (" Could not get commit: \( error ) " )
26
- }
27
-
28
- case .failure (let error):
29
- print (" Could not open repository: \( error ) " )
16
+ .flatMap {
17
+ repo.commit ($0 .oid )
18
+ }
19
+
20
+ switch latestCommit {
21
+ case let .success (commit):
22
+ print (" Latest Commit: \( commit.message ) by \( commit.author .name ) " )
23
+
24
+ case let .failure (error):
25
+ print (" Could not get commit: \( error ) " )
26
+ }
27
+
28
+ case let .failure (error):
29
+ print (" Could not open repository: \( error ) " )
30
30
}
31
31
```
32
32
You can’t perform that action at this time.
0 commit comments