diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-10-01 11:48:08 +0200 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-10-01 11:48:08 +0200 |
commit | 33c8d4879f34402876980d40716a64ae6f888347 (patch) | |
tree | 55d7a5a844c7e3cec5ff6ad0203e5383b5e0204a /lib | |
parent | 979a6df4755a114e38cd1825be40cb07225f1fb4 (diff) | |
parent | 57bc57298c64f40a0a851e474b3e6de91a551ec5 (diff) | |
download | gitlab-shell-33c8d4879f34402876980d40716a64ae6f888347.tar.gz |
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-shell into no-init-on-gcryptsetup
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab_projects.rb | 16 | ||||
-rw-r--r-- | lib/gitlab_shell.rb | 3 |
2 files changed, 15 insertions, 4 deletions
diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb index 11f3820..8bf000d 100644 --- a/lib/gitlab_projects.rb +++ b/lib/gitlab_projects.rb @@ -21,11 +21,19 @@ class GitlabProjects def self.create_hooks(path) local_hooks_directory = File.join(path, 'hooks') + real_local_hooks_directory = :not_found + begin + real_local_hooks_directory = File.realpath(local_hooks_directory) + rescue Errno::ENOENT + # real_local_hooks_directory == :not_found + end - if File.realpath(local_hooks_directory) != File.realpath(GLOBAL_HOOKS_DIRECTORY) - $logger.info "Moving existing hooks directory and symlinking global hooks directory for #{path}." - FileUtils.mv(local_hooks_directory, "#{local_hooks_directory}.old.#{Time.now.to_i}") - FileUtils.ln_s(GLOBAL_HOOKS_DIRECTORY, local_hooks_directory) + if real_local_hooks_directory != File.realpath(GLOBAL_HOOKS_DIRECTORY) + if File.exist?(local_hooks_directory) + $logger.info "Moving existing hooks directory and symlinking global hooks directory for #{path}." + FileUtils.mv(local_hooks_directory, "#{local_hooks_directory}.old.#{Time.now.to_i}") + end + FileUtils.ln_sf(GLOBAL_HOOKS_DIRECTORY, local_hooks_directory) else $logger.info "Hooks already exist for #{path}." true diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb index cbfe468..4bc1cd7 100644 --- a/lib/gitlab_shell.rb +++ b/lib/gitlab_shell.rb @@ -111,6 +111,8 @@ class GitlabShell $logger.info "gitlab-shell: executing git-annex command <#{parsed_args.join(' ')}> for #{log_username}." exec_cmd(*parsed_args) + elsif @git_cmd == 'git-lfs-authenticate' + exec_cmd(@origin_cmd) else $logger.info "gitlab-shell: executing git command <#{@git_cmd} #{repo_full_path}> for #{log_username}." exec_cmd(@git_cmd, repo_full_path) @@ -122,6 +124,7 @@ class GitlabShell env = { 'PATH' => ENV['PATH'], 'LD_LIBRARY_PATH' => ENV['LD_LIBRARY_PATH'], + 'LANG' => ENV['LANG'], 'GL_ID' => @key_id } |