OSDN Git Service

Fix removeing project if repo not exists
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Fri, 25 Jan 2013 11:47:54 +0000 (13:47 +0200)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Fri, 25 Jan 2013 11:47:54 +0000 (13:47 +0200)
lib/gitlab/backend/gitolite_config.rb

index f12c10c..e4ebd59 100644 (file)
@@ -88,7 +88,10 @@ module Gitlab
     end
 
     def destroy_project(project)
-      FileUtils.rm_rf(project.repository.path_to_repo)
+      # do rm-rf only if repository exists
+      if project.repository
+        FileUtils.rm_rf(project.repository.path_to_repo)
+      end
       conf.rm_repo(project.path_with_namespace)
     end