Commit aa97ff7fde07a682db59bbcfbac21cf35d8acc08

Authored by Dmitriy Zaporozhets
1 parent f9528bfb

Fixed tree logs for branches with slash. Fixed remember of path when switch branch

app/controllers/refs_controller.rb
... ... @@ -12,7 +12,7 @@ class RefsController < ProjectResourceController
12 12 respond_to do |format|
13 13 format.html do
14 14 new_path = if params[:destination] == "tree"
15   - project_tree_path(@project, @ref)
  15 + project_tree_path(@project, (@ref + "/" + params[:path]))
16 16 else
17 17 project_commits_path(@project, @ref)
18 18 end
... ...
config/routes.rb
... ... @@ -158,7 +158,7 @@ Gitlab::Application.routes.draw do
158 158 resources :deploy_keys
159 159 resources :protected_branches, only: [:index, :create, :destroy]
160 160  
161   - resources :refs, only: [], path: "/" do
  161 + resources :refs, only: [] do
162 162 collection do
163 163 get "switch"
164 164 end
... ...
lib/extracts_path.rb
... ... @@ -52,7 +52,7 @@ module ExtractsPath
52 52  
53 53 # Remove project, actions and all other staff from path
54 54 input.gsub!(/^\/#{Regexp.escape(@project.path_with_namespace)}/, "")
55   - input.gsub!(/^\/(tree|commits|blame|blob)\//, "") # remove actions
  55 + input.gsub!(/^\/(tree|commits|blame|blob|refs)\//, "") # remove actions
56 56 input.gsub!(/\?.*$/, "") # remove stamps suffix
57 57 input.gsub!(/.atom$/, "") # remove rss feed
58 58 input.gsub!(/\/edit$/, "") # remove edit route part
... ...