Skip to content
Snippets Groups Projects
Commit d8f0db01 authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Use root ref instead of HEAD to find latest repository commit

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