Commit caa06567 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #825 from demelziraptor/master

View project pages without master branch
parents 1b85cbc6 e5bbefc9
......@@ -23,11 +23,11 @@ class Commit
class << self
def find_or_first(repo, commit_id = nil)
def find_or_first(repo, commit_id = nil, root_ref)
commit = if commit_id
repo.commit(commit_id)
else
repo.commits.first
repo.commits(root_ref).first
end
Commit.new(commit) if commit
end
......
......@@ -8,7 +8,7 @@ module Project::RepositoryTrait
end
def commit(commit_id = nil)
Commit.find_or_first(repo, commit_id)
Commit.find_or_first(repo, commit_id, root_ref)
end
def fresh_commits(n = 10)
......
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