# File lib/gitlab/satellite.rb, line 8 def initialize project self.project = project end
will be deleted all branches except PARKING_BRANCH
# File lib/gitlab/satellite.rb, line 25 def clear Dir.chdir(path) do heads = Grit::Repo.new(".").heads.map{|head| head.name} if heads.include? PARKING_BRANCH %xgit checkout #{PARKING_BRANCH}` else %xgit checkout -b #{PARKING_BRANCH}` end heads.delete(PARKING_BRANCH) heads.each do |head| %xgit branch -D #{head}` end end end
# File lib/gitlab/satellite.rb, line 12 def create %xgit clone #{project.url_to_repo} #{path}` end
# File lib/gitlab/satellite.rb, line 20 def exists? File.exists? path end
# File lib/gitlab/satellite.rb, line 16 def path Rails.root.join("tmp", "repo_satellites", project.path) end