We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7f4b26 commit d4eddcdCopy full SHA for d4eddcd
lib/git/log.rb
@@ -89,6 +89,11 @@ def first
89
check_log
90
@commits.first rescue nil
91
end
92
+
93
+ def last
94
+ check_log
95
+ @commits.last rescue nil
96
+ end
97
98
private
99
tests/units/test_log.rb
@@ -9,9 +9,13 @@ def setup
9
@git = Git.open(@wdir)
10
11
12
- def test_get_log_entries
+ def test_get_fisrt_and_last_entries
13
log = @git.log
14
assert(log.first.is_a?(Git::Object::Commit))
15
+ assert_equal('5e53019b3238362144c2766f02a2c00d91fcc023', log.first.objectish)
16
17
+ assert(log.last.is_a?(Git::Object::Commit))
18
+ assert_equal('f1410f8735f6f73d3599eb9b5cdd2fb70373335c', log.last.objectish)
19
20
21
def test_get_log_entries
0 commit comments