diff options
author | Valery Sizov <vsv2711@gmail.com> | 2012-04-22 16:14:01 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2012-04-22 16:14:01 +0300 |
commit | e5f8397fd4360ad21ba2f7e9abedb2707f33033f (patch) | |
tree | 9abcbe72240b4837a319b6b54fe9dc0a73628473 /app | |
parent | dcbb875c46d59c4fba6d3554b87d6d9153791a66 (diff) | |
download | gitlab-ce-e5f8397fd4360ad21ba2f7e9abedb2707f33033f.tar.gz |
fast automerge: done
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project/hooks_trait.rb | 4 | ||||
-rw-r--r-- | app/models/project/repository_trait.rb | 17 |
2 files changed, 4 insertions, 17 deletions
diff --git a/app/models/project/hooks_trait.rb b/app/models/project/hooks_trait.rb index c290ae64f83..2f97eb6c379 100644 --- a/app/models/project/hooks_trait.rb +++ b/app/models/project/hooks_trait.rb @@ -102,8 +102,8 @@ module Project::HooksTrait # Execute web hooks self.execute_web_hooks(oldrev, newrev, ref, user) - # Create repo satellite - self.create_repo_satellite unless self.satellite_exists? + # Create satellite + self.satellite.create unless self.satellite.exists? end end end diff --git a/app/models/project/repository_trait.rb b/app/models/project/repository_trait.rb index ee305a08321..d8bdbf2403b 100644 --- a/app/models/project/repository_trait.rb +++ b/app/models/project/repository_trait.rb @@ -37,21 +37,8 @@ module Project::RepositoryTrait end end - def path_to_repo_satellite - File.join(Rails.root, "tmp", "repo_satellites", self.path) - end - - def satellite_exists? - File.exist? path_to_repo_satellite - end - - def create_repo_satellite - `git clone #{url_to_repo} #{path_to_repo_satellite}` - Dir.chdir(path_to_repo_satellite) do - primary_branch = Grit::Repo.new(".").heads.first.name #usually it`s master - `git checkout -b __parking_branch` - `git branch -D #{primary_branch}` - end + def satellite + @satellite ||= Gitlabhq::Satellite.new(self) end def write_hook(name, content) |