Merge pull request #2706 from jfut/gh-issue-2602

Remove relative_url_root from path. Fixes #2602
This commit is contained in:
Dmitriy Zaporozhets 2013-01-23 10:14:28 -08:00
commit d9027df5b5
2 changed files with 25 additions and 0 deletions

View file

@ -50,6 +50,8 @@ module ExtractsPath
return pair unless @project
# Remove relative_url_root from path
input.gsub!(/^#{Gitlab.config.gitlab.relative_url_root}/, "")
# Remove project, actions and all other staff from path
input.gsub!(/^\/#{Regexp.escape(@project.path_with_namespace)}/, "")
input.gsub!(/^\/(tree|commits|blame|blob|refs)\//, "") # remove actions