From e00389a4fcc67e016b9c71fd209b1bd8e519d4dc Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Mon, 24 Jun 2013 23:37:09 -0400 Subject: [PATCH] fix for bare repos --- services/api/script/crunch-dispatch.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb index 35e03edc5f..ab49aabc29 100755 --- a/services/api/script/crunch-dispatch.rb +++ b/services/api/script/crunch-dispatch.rb @@ -90,10 +90,17 @@ class Dispatcher commit = Commit.where(sha1: job.script_version).first if commit cmd_args << '--git-dir' - cmd_args << File. - join(Rails.configuration.git_repositories_dir, - commit.repository_name, - '.git') + if File.exists?(File. + join(Rails.configuration.git_repositories_dir, + commit.repository_name + '.git')) + cmd_args << File. + join(Rails.configuration.git_repositories_dir, + commit.repository_name + '.git') + else + cmd_args << File. + join(Rails.configuration.git_repositories_dir, + commit.repository_name, '.git') + end end $stderr.puts "dispatch: #{cmd_args.join ' '}" -- 2.30.2