Commit e5bbefc98025b1b9f67b8635807d43f60be55c30
1 parent
1b85cbc6
Exists in
master
and in
4 other branches
change find_or_first to work with default branch
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
app/models/commit.rb
... | ... | @@ -23,11 +23,11 @@ class Commit |
23 | 23 | |
24 | 24 | |
25 | 25 | class << self |
26 | - def find_or_first(repo, commit_id = nil) | |
26 | + def find_or_first(repo, commit_id = nil, root_ref) | |
27 | 27 | commit = if commit_id |
28 | 28 | repo.commit(commit_id) |
29 | 29 | else |
30 | - repo.commits.first | |
30 | + repo.commits(root_ref).first | |
31 | 31 | end |
32 | 32 | Commit.new(commit) if commit |
33 | 33 | end | ... | ... |
app/models/project/repository_trait.rb