diff options
author | Stan Hu <stanhu@gmail.com> | 2015-06-23 05:30:21 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-06-23 05:34:21 -0700 |
commit | 555fd0cf4ab9474f84b3fcf4a4045fdac181b5f7 (patch) | |
tree | 2e552bcd1a199c112baa61013e151eb0a7149d23 /lib | |
parent | 883438970df30ac7101d8f32b30007c4248c75d5 (diff) | |
download | gitlab-ce-555fd0cf4ab9474f84b3fcf4a4045fdac181b5f7.tar.gz |
Fix downloading of patches on public merge requests when user logged out
Closes #1225
Closes #1854
Closes #1858
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/backend/shell_env.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/satellite/action.rb | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/gitlab/backend/shell_env.rb b/lib/gitlab/backend/shell_env.rb index 044afb27f3f..17ec029eed4 100644 --- a/lib/gitlab/backend/shell_env.rb +++ b/lib/gitlab/backend/shell_env.rb @@ -6,7 +6,9 @@ module Gitlab def set_env(user) # Set GL_ID env variable - ENV['GL_ID'] = "user-#{user.id}" + if user + ENV['GL_ID'] = "user-#{user.id}" + end end def reset_env diff --git a/lib/gitlab/satellite/action.rb b/lib/gitlab/satellite/action.rb index 4890ccf21e6..489070f1a3f 100644 --- a/lib/gitlab/satellite/action.rb +++ b/lib/gitlab/satellite/action.rb @@ -39,8 +39,10 @@ module Gitlab def prepare_satellite!(repo) project.satellite.clear_and_update! - repo.config['user.name'] = user.name - repo.config['user.email'] = user.email + if user + repo.config['user.name'] = user.name + repo.config['user.email'] = user.email + end end def default_options(options = {}) |