summaryrefslogtreecommitdiff
path: root/lib/api/helpers/internal_helpers.rb
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2017-05-23 11:34:58 -0700
committerMichael Kozono <mkozono@gmail.com>2017-06-05 05:32:26 -0700
commitb50a22894d4503cf99cecb8162696f854e1b3f85 (patch)
tree053a38452ae5b627e0aa33599cd0f03d523b0285 /lib/api/helpers/internal_helpers.rb
parent0a0f66c816469e197237a6eeaedeb959b5d1c823 (diff)
downloadgitlab-ce-b50a22894d4503cf99cecb8162696f854e1b3f85.tar.gz
Refactor construction of response
Diffstat (limited to 'lib/api/helpers/internal_helpers.rb')
-rw-r--r--lib/api/helpers/internal_helpers.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/api/helpers/internal_helpers.rb b/lib/api/helpers/internal_helpers.rb
index 264df7271a3..d3732d67622 100644
--- a/lib/api/helpers/internal_helpers.rb
+++ b/lib/api/helpers/internal_helpers.rb
@@ -42,6 +42,22 @@ module API
@project, @wiki = Gitlab::RepoPath.parse(params[:project])
end
end
+
+ # Project id to pass between components that don't share/don't have
+ # access to the same filesystem mounts
+ def gl_repository
+ Gitlab::GlRepository.gl_repository(project, wiki?)
+ end
+
+ # Return the repository full path so that gitlab-shell has it when
+ # handling ssh commands
+ def repository_path
+ if wiki?
+ project.wiki.repository.path_to_repo
+ else
+ project.repository.path_to_repo
+ end
+ end
end
end
end