From fcfb6d8438c5a728a0ea6f026f9b1297c3ec3a1a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 11 Feb 2013 09:15:42 +0200 Subject: [PATCH] Since gitlab-shell no sense to check hooks --- app/models/repository.rb | 19 ------------------- app/views/admin/projects/show.html.haml | 24 ------------------------ 2 files changed, 43 deletions(-) diff --git a/app/models/repository.rb b/app/models/repository.rb index 6bfdf225..6d490980 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -60,25 +60,6 @@ class Repository Commit.commits_between(repo, from, to) end - def has_post_receive_file? - !!hook_file - end - - def valid_post_receive_file? - valid_hook_file == hook_file - end - - def valid_hook_file - @valid_hook_file ||= File.read(Rails.root.join('lib', 'hooks', 'post-receive')) - end - - def hook_file - @hook_file ||= begin - hook_path = File.join(path_to_repo, 'hooks', 'post-receive') - File.read(hook_path) if File.exists?(hook_path) - end - end - # Returns an Array of branch names def branch_names repo.branches.collect(&:name).sort diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml index b9294bba..65b92117 100644 --- a/app/views/admin/projects/show.html.haml +++ b/app/views/admin/projects/show.html.haml @@ -4,24 +4,6 @@ %i.icon-edit Edit -- if @repository && @repository.has_commits? - - if !@repository.has_post_receive_file? - %br - .alert.alert-error - %span - %strong Project has commits but missing post-receive file. - %br - If you exported project manually - make a link of post-receive hook file from gitolite to project repository - - elsif !@repository.valid_post_receive_file? - %br - .alert.alert-error - %span - %strong Project has invalid post-receive file. - %br - 1. Make sure your gitolite instace has latest post-receive file. - %br - 2. Make a link of post-receive hook file from gitolite to project repository - %br %table.zebra-striped @@ -103,12 +85,6 @@ Last commit at: %td = last_commit(@project) - %tr - %td - %b - Post Receive File: - %td - = check_box_tag :post_receive_file, 1, @repository.has_post_receive_file?, disabled: true %br %h5