diff options
author | Jeroen Nijhof <jeroen@jeroennijhof.nl> | 2015-11-19 15:16:04 +0100 |
---|---|---|
committer | Jeroen Nijhof <jeroen@jeroennijhof.nl> | 2015-11-19 15:16:04 +0100 |
commit | f487dcb07538d917a3c002694bb160b5900e85be (patch) | |
tree | 07c82fa35199966e07e2e639d56782ea57150990 /lib | |
parent | d2b77063675b25513b9af8d6a3521c429732552f (diff) | |
download | gitlab-shell-f487dcb07538d917a3c002694bb160b5900e85be.tar.gz |
Check if path exists for gc
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab_projects.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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 |