Commit f487dcb0 authored by Jeroen Nijhof's avatar Jeroen Nijhof

Check if path exists for gc

parent d2b77063
...@@ -250,6 +250,10 @@ class GitlabProjects ...@@ -250,6 +250,10 @@ class GitlabProjects
def gc def gc
$logger.info "Running git gc for <#{full_path}>." $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) cmd = %W(git --git-dir=#{full_path} gc)
system(*cmd) system(*cmd)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment