Fix that branch checkouts always pull master instead of origin branch

This commit is contained in:
Michael Friedrich 2017-09-21 13:58:55 +02:00 committed by root
parent 4767782866
commit 699bd3e962
1 changed files with 5 additions and 4 deletions

View File

@ -27,15 +27,16 @@ config['projects'].each do |project_name, project_config|
puts 'Cloning ...'
FileUtils.mkdir_p(project_dir)
repo = Git.clone(project_config['git'], clone_target)
puts "Checkout ref '#{project_config['ref']}'"
repo.branch(project_config['ref']).checkout
else
repo = Git.open(clone_target)
repo.fetch()
puts "Checkout ref '#{project_config['ref']}'"
repo.branch(project_config['ref']).checkout
repo.pull('origin', project_config['ref'])
end
puts "Checkout ref '#{project_config['ref']}'"
repo.branch(project_config['ref']).checkout
repo.pull()
puts "Building page index from #{project_docs_dir}"
Dir.glob("#{project_docs_dir}/*.md", File::FNM_CASEFOLD).sort.each do |file|
filepath = file.gsub('projects/', '')