Skip to content
Snippets Groups Projects
Commit 05b39e06 authored by Jeroen Nijhof's avatar Jeroen Nijhof
Browse files

Use git pull if the repository exists

parent 7f0ba244
No related branches found
No related tags found
1 merge request!39Use git pull if the repository exists
Loading
Loading
@@ -31,8 +31,12 @@ def main
tmp_dir = File.join('/tmp/gitlab', relative_path)
 
unless 'no-clone' == ARGV[0]
system("rm -rf #{tmp_dir}")
system("git clone #{ENV['PROGRESS'] ? nil : '--quiet'} -- #{clone_url} #{tmp_dir}")
if File.exist?("#{tmp_dir}/.git/config")
system("git -C #{tmp_dir} #{ENV['PROGRESS'] ? nil : '--quiet'} pull")
else
system("rm -rf #{tmp_dir}")
system("git clone #{ENV['PROGRESS'] ? nil : '--quiet'} -- #{clone_url} #{tmp_dir}")
end
end
 
$progress.puts 'Deleting files that should be excluded'
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment