diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2015-07-16 14:41:25 +0200 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2015-07-16 14:41:25 +0200 |
commit | 919e70c86a8dac08de0705310d2b6d6b21e022c3 (patch) | |
tree | 647708eedaa2bf3bfaf45237d18e3cd898cf0a27 | |
parent | 7b692799adde84433a37b250c5d7e36483fbf5f7 (diff) | |
download | gitlab-shell-git_annex_env_variable.tar.gz |
If git-annex is enabled set GIT_ANNEX_SHELL_LIMITED variable.git_annex_env_variable
-rw-r--r-- | lib/gitlab_shell.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb index 7c75910..57c319c 100644 --- a/lib/gitlab_shell.rb +++ b/lib/gitlab_shell.rb @@ -119,7 +119,17 @@ class GitlabShell # This method is not covered by Rspec because it ends the current Ruby process. def exec_cmd(*args) - Kernel::exec({ 'PATH' => ENV['PATH'], 'LD_LIBRARY_PATH' => ENV['LD_LIBRARY_PATH'], 'GL_ID' => @key_id }, *args, unsetenv_others: true) + env = { + 'PATH' => ENV['PATH'], + 'LD_LIBRARY_PATH' => ENV['LD_LIBRARY_PATH'], + 'GL_ID' => @key_id + } + + if @config.git_annex_enabled? + env.merge!({ 'GIT_ANNEX_SHELL_LIMITED' => '1' }) + end + + Kernel::exec(env, *args, unsetenv_others: true) end def api |