match/lib/match/storage/git_storage.rb in fastlane-2.132.0.beta.20190917200011 vs match/lib/match/storage/git_storage.rb in fastlane-2.132.0.beta.20190918200023
- old
+ new
@@ -15,10 +15,11 @@
attr_accessor :git_full_name
attr_accessor :git_user_email
attr_accessor :clone_branch_directly
attr_accessor :type
attr_accessor :platform
+ attr_accessor :git_basic_authorization
def self.configure(params)
return self.new(
type: params[:type].to_s,
platform: params[:platform].to_s,
@@ -26,11 +27,12 @@
shallow_clone: params[:shallow_clone],
skip_docs: params[:skip_docs],
branch: params[:git_branch],
git_full_name: params[:git_full_name],
git_user_email: params[:git_user_email],
- clone_branch_directly: params[:clone_branch_directly]
+ clone_branch_directly: params[:clone_branch_directly],
+ git_basic_authorization: params[:git_basic_authorization]
)
end
def initialize(type: nil,
platform: nil,
@@ -38,18 +40,20 @@
shallow_clone: nil,
skip_docs: false,
branch: "master",
git_full_name: nil,
git_user_email: nil,
- clone_branch_directly: false)
+ clone_branch_directly: false,
+ git_basic_authorization: nil)
self.git_url = git_url
self.shallow_clone = shallow_clone
self.skip_docs = skip_docs
self.branch = branch
self.git_full_name = git_full_name
self.git_user_email = git_user_email
self.clone_branch_directly = clone_branch_directly
+ self.git_basic_authorization = git_basic_authorization
self.type = type if type
self.platform = platform if platform
end
@@ -63,9 +67,11 @@
# No existing working directory, creating a new one now
self.working_directory = Dir.mktmpdir
command = "git clone #{self.git_url.shellescape} #{self.working_directory.shellescape}"
+ command << " -c http.extraheader='AUTHORIZATION: basic #{self.git_basic_authorization.shellescape}'" unless self.git_basic_authorization.nil?
+
if self.shallow_clone
command << " --depth 1 --no-single-branch"
elsif self.clone_branch_directly
command += " -b #{self.branch.shellescape} --single-branch"
end