summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Nijhof <jeroen@jeroennijhof.nl>2015-11-19 15:16:04 +0100
committerJeroen Nijhof <jeroen@jeroennijhof.nl>2015-11-19 15:16:04 +0100
commitf487dcb07538d917a3c002694bb160b5900e85be (patch)
tree07c82fa35199966e07e2e639d56782ea57150990
parentd2b77063675b25513b9af8d6a3521c429732552f (diff)
downloadgitlab-shell-f487dcb07538d917a3c002694bb160b5900e85be.tar.gz
Check if path exists for gc
-rw-r--r--lib/gitlab_projects.rb4
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