summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab_access.rb7
-rw-r--r--lib/gitlab_net.rb5
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/gitlab_access.rb b/lib/gitlab_access.rb
index 04806b2..c1b30b0 100644
--- a/lib/gitlab_access.rb
+++ b/lib/gitlab_access.rb
@@ -21,7 +21,12 @@ class GitlabAccess
end
def exec
- status = api.check_access('git-receive-pack', @repo_name, @actor, @changes, @protocol)
+ env = {
+ "GIT_ALTERNATE_OBJECT_DIRECTORIES" => ENV["GIT_ALTERNATE_OBJECT_DIRECTORIES"],
+ "GIT_OBJECT_DIRECTORY" => ENV["GIT_OBJECT_DIRECTORY"]
+ }
+
+ status = api.check_access('git-receive-pack', @repo_name, @actor, @changes, @protocol, env: env.to_json)
raise AccessDeniedError, status.message unless status.allowed?
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb
index 994f8d5..30fe5c4 100644
--- a/lib/gitlab_net.rb
+++ b/lib/gitlab_net.rb
@@ -15,14 +15,15 @@ class GitlabNet
CHECK_TIMEOUT = 5
READ_TIMEOUT = 300
- def check_access(cmd, repo, actor, changes, protocol)
+ def check_access(cmd, repo, actor, changes, protocol, env: {})
changes = changes.join("\n") unless changes.kind_of?(String)
params = {
action: cmd,
changes: changes,
project: project_name(repo),
- protocol: protocol
+ protocol: protocol,
+ env: env
}
if actor =~ /\Akey\-\d+\Z/