match/lib/match/storage/git_storage.rb in fastlane-2.115.0.beta.20190119200019 vs match/lib/match/storage/git_storage.rb in fastlane-2.115.0.beta.20190120200101
- old
+ new
@@ -58,11 +58,11 @@
return if @working_directory
# No existing working directory, creating a new one now
self.working_directory = Dir.mktmpdir
- command = "git clone '#{self.git_url}' '#{self.working_directory}'"
+ command = "git clone #{self.git_url.shellescape} #{self.working_directory.shellescape}"
if self.shallow_clone
command << " --depth 1 --no-single-branch"
elsif self.clone_branch_directly
command += " -b #{self.branch.shellescape} --single-branch"
end
@@ -72,13 +72,15 @@
UI.message("If cloning the repo takes too long, you can use the `clone_branch_directly` option in match.")
end
begin
# GIT_TERMINAL_PROMPT will fail the `git clone` command if user credentials are missing
- FastlaneCore::CommandExecutor.execute(command: "GIT_TERMINAL_PROMPT=0 #{command}",
- print_all: FastlaneCore::Globals.verbose?,
- print_command: FastlaneCore::Globals.verbose?)
+ 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
@@ -191,16 +193,18 @@
end
def git_push(commands: [], commit_message: nil)
commit_message ||= generate_commit_message
commands << "git commit -m #{commit_message.shellescape}"
- commands << "GIT_TERMINAL_PROMPT=0 git push origin #{self.branch.shellescape}"
+ commands << "git push origin #{self.branch.shellescape}"
UI.message("Pushing changes to remote git repo...")
- commands.each do |command|
- FastlaneCore::CommandExecutor.execute(command: command,
+ Helper.with_env_values('GIT_TERMINAL_PROMPT' => '0') do
+ commands.each do |command|
+ FastlaneCore::CommandExecutor.execute(command: command,
print_all: FastlaneCore::Globals.verbose?,
- print_command: FastlaneCore::Globals.verbose?)
+ print_command: FastlaneCore::Globals.verbose?)
+ end
end
self.clear_changes
rescue => ex
UI.error("Couldn't commit or push changes back to git...")