Skip to content

Commit b100a7a

Browse files
fix proper return value of check_hooks_installed now that locking has been added
1 parent 1393acb commit b100a7a

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

lib/git_hosting.rb

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -488,19 +488,24 @@ def self.clear_cache_for_project(project)
488488

489489

490490
def self.check_hooks_installed
491-
lock(5)
492-
GitAdapterHooks.check_hooks_installed
493-
unlock()
491+
installed = false
492+
if lock(5)
493+
installed = GitAdapterHooks.check_hooks_installed
494+
unlock()
495+
end
496+
installed
494497
end
495498
def self.setup_hooks(projects=nil)
496-
lock(5)
497-
GitAdapterHooks.setup_hooks(projects)
498-
unlock()
499+
if lock(5)
500+
GitAdapterHooks.setup_hooks(projects)
501+
unlock()
502+
end
499503
end
500504
def self.update_global_hook_params
501-
lock(5)
502-
GitAdapterHooks.update_global_hook_params
503-
unlock()
505+
if lock(5)
506+
GitAdapterHooks.update_global_hook_params
507+
unlock()
508+
end
504509
end
505510
end
506511

0 commit comments

Comments
 (0)