Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

When a repository is deleted rm -rf the location of the repository.

  • Loading branch information...
commit dbdb6ed9e38e510d0e85cf6da8eeb3073ee46535 1 parent ad01193
@icefox authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 web/app/models/repository.rb
View
8 web/app/models/repository.rb
@@ -1,4 +1,5 @@
require 'grit'
+require 'fileutils'
class Repository < ActiveRecord::Base
belongs_to :user
@@ -55,6 +56,13 @@ def copy(other)
self.forked_repository_id = other.id
end
+ def destroy
+ super
+ if File.exists?(location())
+ FileUtils.rm_rf location()
+ end
+ end
+
private
def existing_branch_name
if self.defaultbranch.empty?
Please sign in to comment.
Something went wrong with that request. Please try again.