diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-05-23 21:34:58 +0300 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-06-05 15:32:26 +0300 |
commit | b50a22894d4503cf99cecb8162696f854e1b3f85 (patch) | |
tree | 053a38452ae5b627e0aa33599cd0f03d523b0285 /lib/api/internal.rb | |
parent | 0a0f66c816469e197237a6eeaedeb959b5d1c823 (diff) |
Refactor construction of response
Diffstat (limited to 'lib/api/internal.rb')
-rw-r--r-- | lib/api/internal.rb | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb index 3d60d1da114..f2d41754afd 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -37,26 +37,18 @@ module API .new(actor, project, protocol, authentication_abilities: ssh_authentication_abilities) begin - access_status = access_checker.check(params[:action], params[:changes]) - response = { status: access_status.status, message: access_status.message } + access_checker.check(params[:action], params[:changes]) rescue Gitlab::GitAccess::UnauthorizedError, Gitlab::GitAccess::NotFoundError => e return { status: false, message: e.message } end log_user_activity(actor) - # Project id to pass between components that don't share/don't have - # access to the same filesystem mounts - response[:gl_repository] = Gitlab::GlRepository.gl_repository(project, wiki?) - - # Return the repository full path so that gitlab-shell has it when - # handling ssh commands - response[:repository_path] = - if wiki? - project.wiki.repository.path_to_repo - else - project.repository.path_to_repo - end + response = { + status: true, + gl_repository: gl_repository, + repository_path: repository_path + } response end |