diff options
author | Sean McGivern <sean@gitlab.com> | 2016-06-28 17:25:32 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-07-08 10:56:55 +0100 |
commit | b6b26692ea44cfeab7e8fd64b7df60852850fce2 (patch) | |
tree | 3f54b14b7b8500d0182d7e5eca653b313eec17e2 /config | |
parent | 2c650b6f30d2e76cf632d6ce5771859aed67ac48 (diff) | |
download | gitlab-ce-b6b26692ea44cfeab7e8fd64b7df60852850fce2.tar.gz |
Collapse large diffs by default
When rendering a list of diff files, skip those where the diff is over
10 KB and provide an endpoint to render individually instead.
Diffstat (limited to 'config')
-rw-r--r-- | config/routes.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/config/routes.rb b/config/routes.rb index 18a4ead2b37..f31f8171993 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -615,10 +615,18 @@ Rails.application.routes.draw do post :retry_builds post :revert post :cherry_pick + get '/diffs/*path', action: :diff_for_path, constraints: { format: false } end end - resources :compare, only: [:index, :create] + resources :compare, only: [:index, :create] do + collection do + get '/diffs/*path', action: :diff_for_path, constraints: { format: false } + end + end + + get '/compare/:from...:to', to: 'compare#show', as: 'compare', constraints: { from: /.+/, to: /.+/ } + resources :network, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } resources :graphs, only: [:show], constraints: { id: /(?:[^.]|\.(?!json$))+/, format: /json/ } do @@ -629,9 +637,6 @@ Rails.application.routes.draw do end end - get '/compare/:from...:to' => 'compare#show', :as => 'compare', - :constraints => { from: /.+/, to: /.+/ } - resources :snippets, constraints: { id: /\d+/ } do member do get 'raw' @@ -706,12 +711,14 @@ Rails.application.routes.draw do post :toggle_subscription post :toggle_award_emoji post :remove_wip + get '/diffs/*path', action: :diff_for_path, constraints: { format: false } end collection do get :branch_from get :branch_to get :update_branches + get '/diffs/*path', action: :diff_for_path, constraints: { format: false } end end |