File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
en/book/10-git-in-other-environments Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -290,9 +290,7 @@ Again, here's how to read HEAD's commit message:
290
290
-----
291
291
GTRepository *repo =
292
292
[[GTRepository alloc] initWithURL:[NSURL fileURLWithPath: @"/path/to/repo"] error:NULL];
293
- GTReference *head = [repo headReferenceWithError:NULL];
294
- GTCommit *tip = head.resolvedTarget;
295
- NSString *message = tip.message;
293
+ NSString *msg = [[[repo headReferenceWithError:NULL] resolvedTarget] message];
296
294
-----
297
295
298
296
===== rugged
@@ -303,9 +301,7 @@ Once again, HEAD's commit message:
303
301
[source,ruby]
304
302
----
305
303
repo = Rugged::Repository.new('path/to/my/repository')
306
- head = repo.head
307
- tip = repo.lookup head.resolve.target
308
- msg = tip.message
304
+ msg = repo.lookup(repo.head.resolve.target).message
309
305
----
310
306
311
307
You can’t perform that action at this time.
0 commit comments