From 699bd3e9620920299986ca612488f0a4f4dd3dcc Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 21 Sep 2017 13:58:55 +0200 Subject: [PATCH] Fix that branch checkouts always pull master instead of origin branch --- build-docs.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build-docs.rb b/build-docs.rb index ee165db..dd8f693 100755 --- a/build-docs.rb +++ b/build-docs.rb @@ -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/', '')