Make sure tmp/merge_repo is available to write lock files for auto-merge.
This commit is contained in:
parent
204c66461e
commit
21f3da2358
1 changed files with 6 additions and 2 deletions
|
@ -25,8 +25,12 @@ class GitlabMerge
|
|||
end
|
||||
|
||||
def process
|
||||
Grit::Git.with_timeout(30.seconds) do
|
||||
File.open(File.join(Rails.root, "tmp", "merge_repo", "#{project.path}.lock"), "w+") do |f|
|
||||
Grit::Git.with_timeout(30.seconds) do
|
||||
# Make sure tmp/merge_repo exists
|
||||
lock_path = File.join(Rails.root, "tmp", "merge_repo")
|
||||
FileUtils.mkdir_p(lock_path) unless File.exists?(File.join(Rails.root, "tmp", "merge_repo"))
|
||||
|
||||
File.open(File.join(lock_path, "#{project.path}.lock"), "w+") do |f|
|
||||
f.flock(File::LOCK_EX)
|
||||
|
||||
unless project.satellite.exists?
|
||||
|
|
Loading…
Reference in a new issue