dbcf48af8b
When calling pre-receive, post-receive, and update hooks, add the GitLab username as the GL_USERNAME environment variable. This patch only handles cases where pushes are over http, or via the web interface. Later, we will address the ssh case.
22 lines
552 B
Ruby
22 lines
552 B
Ruby
module Gitlab
|
|
module Git
|
|
class User
|
|
attr_reader :username, :name, :email, :gl_id
|
|
|
|
def self.from_gitlab(gitlab_user)
|
|
new(gitlab_user.username, gitlab_user.name, gitlab_user.email, Gitlab::GlId.gl_id(gitlab_user))
|
|
end
|
|
|
|
def initialize(username, name, email, gl_id)
|
|
@username = username
|
|
@name = name
|
|
@email = email
|
|
@gl_id = gl_id
|
|
end
|
|
|
|
def ==(other)
|
|
[username, name, email, gl_id] == [other.username, other.name, other.email, other.gl_id]
|
|
end
|
|
end
|
|
end
|
|
end
|