BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
6e0d17b8
Commit
6e0d17b8
authored
Oct 03, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'restore-user-from-gitaly' into 'master'
Restore User.from_gitaly See merge request gitlab-org/gitlab-ce!14662
parents
69fd4f94
bfd53aa6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
user.rb
lib/gitlab/git/user.rb
+5
-0
user_spec.rb
spec/lib/gitlab/git/user_spec.rb
+14
-0
No files found.
lib/gitlab/git/user.rb
View file @
6e0d17b8
...
...
@@ -7,6 +7,11 @@ module Gitlab
new
(
gitlab_user
.
username
,
gitlab_user
.
name
,
gitlab_user
.
email
,
Gitlab
::
GlId
.
gl_id
(
gitlab_user
))
end
# TODO support the username field in Gitaly https://gitlab.com/gitlab-org/gitaly/issues/628
def
self
.
from_gitaly
(
gitaly_user
)
new
(
''
,
gitaly_user
.
name
,
gitaly_user
.
email
,
gitaly_user
.
gl_id
)
end
def
initialize
(
username
,
name
,
email
,
gl_id
)
@username
=
username
@name
=
name
...
...
spec/lib/gitlab/git/user_spec.rb
View file @
6e0d17b8
...
...
@@ -8,6 +8,20 @@ describe Gitlab::Git::User do
subject
{
described_class
.
new
(
username
,
name
,
email
,
gl_id
)
}
describe
'.from_gitaly'
do
let
(
:gitaly_user
)
{
Gitaly
::
User
.
new
(
name:
name
,
email:
email
,
gl_id:
gl_id
)
}
subject
{
described_class
.
from_gitaly
(
gitaly_user
)
}
it
{
expect
(
subject
).
to
eq
(
described_class
.
new
(
''
,
name
,
email
,
gl_id
))
}
end
describe
'.from_gitlab'
do
let
(
:user
)
{
build
(
:user
)
}
subject
{
described_class
.
from_gitlab
(
user
)
}
it
{
expect
(
subject
).
to
eq
(
described_class
.
new
(
user
.
username
,
user
.
name
,
user
.
email
,
'user-'
))
}
end
describe
'#=='
do
def
eq_other
(
username
,
name
,
email
,
gl_id
)
eq
(
described_class
.
new
(
username
,
name
,
email
,
gl_id
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment