Commit 1b2d19ab authored by Ash McKenzie's avatar Ash McKenzie

git-lfs needs HTTP auth creds always written out

parent 91532018
......@@ -34,13 +34,19 @@ module QA
def username=(username)
@username = username
@uri.user = username
# Only include the user in the URI if we're using HTTP as this breaks
# SSH authentication.
@uri.user = username unless ssh_key_set?
end
def use_default_credentials
self.username, self.password = default_credentials
add_credentials_to_netrc unless ssh_key_set?
# Write out .netrc as we need it for:
#
# git & git-lfs over HTTP
# git-lfs over SSH
add_credentials_to_netrc if add_credentials?
end
def clone(opts = '')
......@@ -139,6 +145,12 @@ module QA
alias_method :use_lfs?, :use_lfs
def add_credentials?
return true unless ssh_key_set?
return true if ssh_key_set? && use_lfs?
false
end
def ssh_key_set?
!private_key_file.nil?
......
......@@ -59,7 +59,11 @@ module QA
repository.use_default_credentials unless user
end
# Needed so git-lfs can work as it uses HTTP for authentication
# regardless of git using SSH or HTTP.
#
repository.use_lfs = use_lfs
repository.use_default_credentials
username = 'GitLab QA'
email = 'root@gitlab.com'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment