From f487dcb07538d917a3c002694bb160b5900e85be Mon Sep 17 00:00:00 2001 From: Jeroen Nijhof Date: Thu, 19 Nov 2015 15:16:04 +0100 Subject: Check if path exists for gc --- lib/gitlab_projects.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/gitlab_projects.rb') diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb index 0497502..461819a 100644 --- a/lib/gitlab_projects.rb +++ b/lib/gitlab_projects.rb @@ -250,6 +250,10 @@ class GitlabProjects def gc $logger.info "Running git gc for <#{full_path}>." + unless File.exists?(full_path) + $logger.error "gc failed: destination path <#{full_path}> does not exist." + return false + end cmd = %W(git --git-dir=#{full_path} gc) system(*cmd) end -- cgit v1.2.1