diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 18:25:58 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 18:25:58 +0000 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /app/controllers/projects/branches_controller.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) | |
download | gitlab-ce-a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4.tar.gz |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'app/controllers/projects/branches_controller.rb')
-rw-r--r-- | app/controllers/projects/branches_controller.rb | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb index 5006aa75ce5..3be10559e80 100644 --- a/app/controllers/projects/branches_controller.rb +++ b/app/controllers/projects/branches_controller.rb @@ -152,7 +152,7 @@ class Projects::BranchesController < Projects::ApplicationController ref_escaped = strip_tags(sanitize(params[:ref])) Addressable::URI.unescape(ref_escaped) else - @project.default_branch || 'master' + @project.default_branch_or_main end end @@ -185,18 +185,12 @@ class Projects::BranchesController < Projects::ApplicationController # Here we get one more branch to indicate if there are more data we're not showing limit = @overview_max_branches + 1 - if Feature.enabled?(:branch_list_keyset_pagination, project, default_enabled: :yaml) - @active_branches = - BranchesFinder.new(@repository, { per_page: limit, sort: sort_value_recently_updated }) - .execute(gitaly_pagination: true).select(&:active?) - @stale_branches = - BranchesFinder.new(@repository, { per_page: limit, sort: sort_value_oldest_updated }) - .execute(gitaly_pagination: true).select(&:stale?) - else - @active_branches, @stale_branches = BranchesFinder.new(@repository, sort: sort_value_recently_updated).execute.partition(&:active?) - @active_branches = @active_branches.first(limit) - @stale_branches = @stale_branches.first(limit) - end + @active_branches = + BranchesFinder.new(@repository, { per_page: limit, sort: sort_value_recently_updated }) + .execute(gitaly_pagination: true).select(&:active?) + @stale_branches = + BranchesFinder.new(@repository, { per_page: limit, sort: sort_value_oldest_updated }) + .execute(gitaly_pagination: true).select(&:stale?) @branches = @active_branches + @stale_branches end |