bypass gitolite update hook, and set an GL_USER variable.

This commit is contained in:
Saito 2012-07-02 16:44:45 +08:00
parent 82e2551833
commit 401340168c
3 changed files with 17 additions and 10 deletions

View file

@ -7,6 +7,11 @@ module Grack
user = User.find_by_email(email)
return false unless user.try(:valid_password?, password)
# Set GL_USER env variable
ENV['GL_USER'] = email
# Pass Gitolite update hook
ENV['GL_BYPASS_UPDATE_HOOK'] = "true"
# Need this patch because the rails mount
@env['PATH_INFO'] = @env['REQUEST_PATH']