Skip to content

Commit f642901

Browse files
committed
Succinctify
1 parent c4bbaee commit f642901

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

en/book/10-git-in-other-environments/chapter10.asc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,7 @@ Again, here's how to read HEAD's commit message:
290290
-----
291291
GTRepository *repo =
292292
[[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];
296294
-----
297295

298296
===== rugged
@@ -303,9 +301,7 @@ Once again, HEAD's commit message:
303301
[source,ruby]
304302
----
305303
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
309305
----
310306

311307

0 commit comments

Comments
 (0)