This instance will be upgraded to Heptapod 0.27.1 on 2021-12-08 at 22:00 UTC+1 (a few minutes of down time)

Commit 04658761 authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Use default_branch rather than master, feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5347#note_13173871
parent de7a583e4a97
......@@ -21,7 +21,7 @@ class Pipeline < ActiveRecord::Base
after_save :keep_around_commits
# ref can't be HEAD or SHA, can only be branch/tag name
scope :latest_successful_for, ->(ref) do
scope :latest_successful_for, ->(ref = default_branch) do
where(ref: ref).success.order(id: :desc)
end
......
......@@ -430,7 +430,7 @@ def commit(ref = 'HEAD')
end
# ref can't be HEAD, can only be branch/tag name or SHA
def latest_successful_builds_for(ref = 'master')
def latest_successful_builds_for(ref = default_branch)
Ci::Build.joins(:pipeline).
merge(pipelines.latest_successful_for(ref)).
latest_successful_with_artifacts
......
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