summaryrefslogtreecommitdiff
path: root/bin/create-hooks
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-09 12:29:49 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-09 12:29:49 +0000
commit2ac1d608c8cb1e07b16eaafdba10324917f3932a (patch)
tree89a3c22795eb6bf4169e6232eb2aa7cf994eed83 /bin/create-hooks
parent1fc4ed6e730a92d35955d68c5228864d0f0a0b21 (diff)
parent96e85094ee2917ad4bf63a0aa075257e15dedf9b (diff)
downloadgitlab-shell-2ac1d608c8cb1e07b16eaafdba10324917f3932a.tar.gz
Merge branch 'rescue_enoent' into 'master'
Ignore missing repositories in create-hooks When bin/create-hooks is run against a live GitLab server, there is a possibility of race conditions when a user deletes one of their repositories after bin/create-hooks found it. With this change, bin/create-hooks will ignore missing file errors. See merge request !40
Diffstat (limited to 'bin/create-hooks')
-rwxr-xr-xbin/create-hooks6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/create-hooks b/bin/create-hooks
index d6f07c7..4efa650 100755
--- a/bin/create-hooks
+++ b/bin/create-hooks
@@ -8,5 +8,9 @@ require_relative '../lib/gitlab_init'
require File.join(ROOT_PATH, 'lib', 'gitlab_projects')
Dir["#{GitlabConfig.new.repos_path}/*/*.git"].each do |repo|
- GitlabProjects.create_hooks(repo)
+ begin
+ GitlabProjects.create_hooks(repo)
+ rescue Errno::ENOENT
+ # The user must have deleted their repository. Ignore.
+ end
end