summaryrefslogtreecommitdiff
path: root/app/controllers/projects/branches_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/branches_controller.rb')
-rw-r--r--app/controllers/projects/branches_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb
index 00811f17adb..8c70ae45f06 100644
--- a/app/controllers/projects/branches_controller.rb
+++ b/app/controllers/projects/branches_controller.rb
@@ -7,7 +7,9 @@ class Projects::BranchesController < Projects::ApplicationController
before_filter :authorize_push!, only: [:create, :destroy]
def index
- @branches = Kaminari.paginate_array(@repository.branches).page(params[:page]).per(30)
+ @sort = params[:sort] || 'name'
+ @branches = @repository.branches_sorted_by(@sort)
+ @branches = Kaminari.paginate_array(@branches).page(params[:page]).per(30)
end
def recent