Commit d8f0db01 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Use root ref instead of HEAD to find latest repository commit

parent 4473b685
...@@ -99,11 +99,11 @@ class Repository ...@@ -99,11 +99,11 @@ class Repository
"#<#{self.class.name}:#{@disk_path}>" "#<#{self.class.name}:#{@disk_path}>"
end end
def commit(ref = 'HEAD') def commit(ref = nil)
return nil unless exists? return nil unless exists?
return ref if ref.is_a?(::Commit) return ref if ref.is_a?(::Commit)
find_commit(ref) find_commit(ref || root_ref)
end end
# Finding a commit by the passed SHA # Finding a commit by the passed SHA
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment