summaryrefslogtreecommitdiff
path: root/lib/gitosis.rb
diff options
context:
space:
mode:
authorgitlabhq <m@gitlabhq.com>2011-10-18 11:21:44 +0300
committergitlabhq <m@gitlabhq.com>2011-10-18 11:21:44 +0300
commit5a5845e4908895ecb8ad60bfc964eaeecdcc43b2 (patch)
treec339b916c9fca15cadbd1a559435cbdf81b0e3d5 /lib/gitosis.rb
parent2daa6161fd08e18bdf7f1ad0f30a83a58226543e (diff)
downloadgitlab-ce-5a5845e4908895ecb8ad60bfc964eaeecdcc43b2.tar.gz
few fixes
Diffstat (limited to 'lib/gitosis.rb')
-rw-r--r--lib/gitosis.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/gitosis.rb b/lib/gitosis.rb
index a9eef96cd3f..cab7da2d435 100644
--- a/lib/gitosis.rb
+++ b/lib/gitosis.rb
@@ -27,13 +27,14 @@ class Gitosis
def configure
status = Timeout::timeout(20) do
File.open(File.join(Dir.tmpdir,"gitlabhq-gitosis.lock"), "w+") do |f|
- f.flock(File::LOCK_EX)
-
- pull
- yield(self)
- push
-
- f.flock(File::LOCK_UN)
+ begin
+ f.flock(File::LOCK_EX)
+ pull
+ yield(self)
+ push
+ ensure
+ f.flock(File::LOCK_UN)
+ end
end
end
rescue Exception => ex