80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
# File 'match/lib/match/storage/git_storage.rb', line 80
def download
return if @working_directory
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}'" unless self.git_basic_authorization.nil?
command << " -c http.extraheader='Authorization: Bearer #{self.git_bearer_authorization}'" unless self.git_bearer_authorization.nil?
if self.shallow_clone
command << " --depth 1"
end
if self.clone_branch_directly
command += " -b #{self.branch.shellescape} --single-branch"
elsif self.shallow_clone
command += " --no-single-branch"
end
command = command_from_private_key(command) unless self.git_private_key.nil?
UI.message("Cloning remote git repo...")
if self.branch && !self.clone_branch_directly
UI.message("If cloning the repo takes too long, you can use the `clone_branch_directly` option in match.")
end
begin
Helper.with_env_values('GIT_TERMINAL_PROMPT' => '0') do
FastlaneCore::CommandExecutor.execute(command: command,
print_all: FastlaneCore::Globals.verbose?,
print_command: FastlaneCore::Globals.verbose?)
end
rescue
UI.error("Error cloning certificates repo, please make sure you have read access to the repository you want to use")
if self.branch && self.clone_branch_directly
UI.error("You passed '#{self.branch}' as branch in combination with the `clone_branch_directly` flag. Please remove `clone_branch_directly` flag on the first run for _match_ to create the branch.")
end
UI.error("Run the following command manually to make sure you're properly authenticated:")
UI.command(command)
UI.user_error!("Error cloning certificates git repo, please make sure you have access to the repository - see instructions above")
end
add_user_config(self.git_full_name, self.git_user_email)
unless File.directory?(self.working_directory)
UI.user_error!("Error cloning repo, make sure you have access to it '#{self.git_url}'")
end
checkout_branch
end
|