diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-06-19 13:56:43 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-06-19 13:56:43 +0000 |
commit | b18c12ec6a9564d55bd2851a82ff2513b8485fe0 (patch) | |
tree | 6c6ddb70860550ca7721aa2d1a90fbdd0e9b1ba1 /lib/api | |
parent | 9af0e8f911040fd3722c55f8c4b6d8302861c9eb (diff) | |
parent | 32b3d09ae5ed778b8d884cd6722f748b39bf87f3 (diff) | |
download | gitlab-ce-b18c12ec6a9564d55bd2851a82ff2513b8485fe0.tar.gz |
Merge branch 'mk-add-project-moved-errors-for-git' into 'master'
Add "project was moved" error messages for git
See merge request !11259
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/helpers/internal_helpers.rb | 7 | ||||
-rw-r--r-- | lib/api/internal.rb | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/api/helpers/internal_helpers.rb b/lib/api/helpers/internal_helpers.rb index d3732d67622..5e9cf5e68b1 100644 --- a/lib/api/helpers/internal_helpers.rb +++ b/lib/api/helpers/internal_helpers.rb @@ -10,6 +10,10 @@ module API set_project unless defined?(@project) @project end + + def redirected_path + @redirected_path + end def ssh_authentication_abilities [ @@ -38,8 +42,9 @@ module API def set_project if params[:gl_repository] @project, @wiki = Gitlab::GlRepository.parse(params[:gl_repository]) + @redirected_path = nil else - @project, @wiki = Gitlab::RepoPath.parse(params[:project]) + @project, @wiki, @redirected_path = Gitlab::RepoPath.parse(params[:project]) end end diff --git a/lib/api/internal.rb b/lib/api/internal.rb index ecd6d672cf7..9ec418edea4 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -34,7 +34,7 @@ module API access_checker_klass = wiki? ? Gitlab::GitAccessWiki : Gitlab::GitAccess access_checker = access_checker_klass - .new(actor, project, protocol, authentication_abilities: ssh_authentication_abilities) + .new(actor, project, protocol, authentication_abilities: ssh_authentication_abilities, redirected_path: redirected_path) begin access_checker.check(params[:action], params[:changes]) |