Skip to content

Commit

Permalink
Add lock around git_exec
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Gehrke committed Aug 8, 2016
1 parent 3356ecb commit bda5480
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/git_repository/cloning.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ def git_exec(*args)
args.push \
GIT_DIR: local_path.to_s,
LANG: 'C'

Subprocess.run *args
Semaphore.exclusively("#{GitRepository::LOCK_NAMESPACE}:#{repo}") do
Subprocess.run(*args)
end
end

# Yields the given block and returns the head OID
Expand Down

0 comments on commit bda5480

Please sign in to comment.