summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2017-08-22 13:05:36 +0200
committerJacob Vosmaer <jacob@gitlab.com>2017-08-23 10:45:20 +0200
commit9b9309329207449ef022bdcf06bff5f8eae36032 (patch)
treea26840a279259159a0f0eddf6865fb57589d40bd /lib
parent0f74ba967296cfb2e2ae65328f93170f453ab687 (diff)
downloadgitlab-ce-9b9309329207449ef022bdcf06bff5f8eae36032.tar.gz
Decouple GitOperationService from User
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/git/committer.rb21
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