diff options
| author | Jacob Vosmaer <jacob@gitlab.com> | 2017-08-22 13:05:36 +0200 |
|---|---|---|
| committer | Jacob Vosmaer <jacob@gitlab.com> | 2017-08-23 10:45:20 +0200 |
| commit | 9b9309329207449ef022bdcf06bff5f8eae36032 (patch) | |
| tree | a26840a279259159a0f0eddf6865fb57589d40bd /lib | |
| parent | 0f74ba967296cfb2e2ae65328f93170f453ab687 (diff) | |
| download | gitlab-ce-9b9309329207449ef022bdcf06bff5f8eae36032.tar.gz | |
Decouple GitOperationService from User
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gitlab/git/committer.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/gitlab/git/committer.rb b/lib/gitlab/git/committer.rb new file mode 100644 index 00000000000..ef3576eaa1c --- /dev/null +++ b/lib/gitlab/git/committer.rb @@ -0,0 +1,21 @@ +module Gitlab + module Git + class Committer + attr_reader :name, :email, :gl_id + + def self.from_user(user) + new(user.name, user.email, Gitlab::GlId.gl_id(user)) + end + + def initialize(name, email, gl_id) + @name = name + @email = email + @gl_id = gl_id + end + + def ==(other) + [name, email, gl_id] == [other.name, other.email, other.gl_id] + end + end + end +end |
