Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
55959343
Commit
55959343
authored
Oct 10, 2018
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract credential logic to #default_credentials
parent
bf577806
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
qa/qa/git/repository.rb
qa/qa/git/repository.rb
+9
-7
No files found.
qa/qa/git/repository.rb
View file @
55959343
...
...
@@ -37,13 +37,7 @@ module QA
end
def
use_default_credentials
if
::
QA
::
Runtime
::
User
.
ldap_user?
self
.
username
=
Runtime
::
User
.
ldap_username
self
.
password
=
Runtime
::
User
.
ldap_password
else
self
.
username
=
Runtime
::
User
.
username
self
.
password
=
Runtime
::
User
.
password
end
self
.
username
,
self
.
password
=
default_credentials
add_credentials_to_netrc
unless
ssh_key_set?
end
...
...
@@ -138,6 +132,14 @@ module QA
output
end
def
default_credentials
if
::
QA
::
Runtime
::
User
.
ldap_user?
[
Runtime
::
User
.
ldap_username
,
Runtime
::
User
.
ldap_password
]
else
[
Runtime
::
User
.
username
,
Runtime
::
User
.
password
]
end
end
def
tmp_netrc_directory
@tmp_netrc_directory
||=
File
.
join
(
Dir
.
tmpdir
,
"qa-netrc-credentials"
,
$$
.
to_s
)
end
...
...
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