summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-01-09 09:34:26 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-01-09 09:34:26 +0200
commitaa97ff7fde07a682db59bbcfbac21cf35d8acc08 (patch)
tree2eec50aad91fc7257ca3f709e4b48a28c42943cb
parentf9528bfb86817efa4af6eaab464936abb3f44ecb (diff)
downloadgitlab-ce-aa97ff7fde07a682db59bbcfbac21cf35d8acc08.tar.gz
Fixed tree logs for branches with slash. Fixed remember of path when switch branch
-rw-r--r--app/controllers/refs_controller.rb2
-rw-r--r--config/routes.rb2
-rw-r--r--lib/extracts_path.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/refs_controller.rb b/app/controllers/refs_controller.rb
index e4eb2d33ea6..09d9eb51b82 100644
--- a/app/controllers/refs_controller.rb
+++ b/app/controllers/refs_controller.rb
@@ -12,7 +12,7 @@ class RefsController < ProjectResourceController
respond_to do |format|
format.html do
new_path = if params[:destination] == "tree"
- project_tree_path(@project, @ref)
+ project_tree_path(@project, (@ref + "/" + params[:path]))
else
project_commits_path(@project, @ref)
end
diff --git a/config/routes.rb b/config/routes.rb
index 5e556dccc27..27188b3b89f 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -158,7 +158,7 @@ Gitlab::Application.routes.draw do
resources :deploy_keys
resources :protected_branches, only: [:index, :create, :destroy]
- resources :refs, only: [], path: "/" do
+ resources :refs, only: [] do
collection do
get "switch"
end
diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb
index 5c96eac02e7..14201ae63ce 100644
--- a/lib/extracts_path.rb
+++ b/lib/extracts_path.rb
@@ -52,7 +52,7 @@ module ExtractsPath
# Remove project, actions and all other staff from path
input.gsub!(/^\/#{Regexp.escape(@project.path_with_namespace)}/, "")
- input.gsub!(/^\/(tree|commits|blame|blob)\//, "") # remove actions
+ input.gsub!(/^\/(tree|commits|blame|blob|refs)\//, "") # remove actions
input.gsub!(/\?.*$/, "") # remove stamps suffix
input.gsub!(/.atom$/, "") # remove rss feed
input.gsub!(/\/edit$/, "") # remove edit route part