| ... | @@ -30,26 +30,10 @@ module Repository |
... | @@ -30,26 +30,10 @@ module Repository |
|
|
Commit.commits_between(repo, from, to)
|
|
Commit.commits_between(repo, from, to)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
def write_hooks
|
|
|
|
|
%w(post-receive).each do |hook|
|
|
|
|
|
write_hook(hook, File.read(File.join(Rails.root, 'lib', "#{hook}-hook")))
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def satellite
|
|
def satellite
|
|
|
@satellite ||= Gitlab::Satellite.new(self)
|
|
@satellite ||= Gitlab::Satellite.new(self)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
def write_hook(name, content)
|
|
|
|
|
hook_file = File.join(path_to_repo, 'hooks', name)
|
|
|
|
|
|
|
|
|
|
File.open(hook_file, 'w') do |f|
|
|
|
|
|
f.write(content)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
File.chmod(0775, hook_file)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def has_post_receive_file?
|
|
def has_post_receive_file?
|
|
|
hook_file = File.join(path_to_repo, 'hooks', 'post-receive')
|
|
hook_file = File.join(path_to_repo, 'hooks', 'post-receive')
|
|
|
File.exists?(hook_file)
|
|
File.exists?(hook_file)
|
| ... | @@ -73,8 +57,6 @@ module Repository |
... | @@ -73,8 +57,6 @@ module Repository |
|
|
|
|
|
|
|
def update_repository
|
|
def update_repository
|
|
|
Gitlab::GitHost.system.update_project(path, self)
|
|
Gitlab::GitHost.system.update_project(path, self)
|
|
|
|
|
|
|
|
write_hooks if File.exists?(path_to_repo)
|
|
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
def destroy_repository
|
|
def destroy_repository
|
| ... | |
... | |
| ... | | ... | |