Commit fcfb6d8438c5a728a0ea6f026f9b1297c3ec3a1a

Authored by Dmitriy Zaporozhets
1 parent a404c438

Since gitlab-shell no sense to check hooks

app/models/repository.rb
@@ -60,25 +60,6 @@ class Repository @@ -60,25 +60,6 @@ class Repository
60 Commit.commits_between(repo, from, to) 60 Commit.commits_between(repo, from, to)
61 end 61 end
62 62
63 - def has_post_receive_file?  
64 - !!hook_file  
65 - end  
66 -  
67 - def valid_post_receive_file?  
68 - valid_hook_file == hook_file  
69 - end  
70 -  
71 - def valid_hook_file  
72 - @valid_hook_file ||= File.read(Rails.root.join('lib', 'hooks', 'post-receive'))  
73 - end  
74 -  
75 - def hook_file  
76 - @hook_file ||= begin  
77 - hook_path = File.join(path_to_repo, 'hooks', 'post-receive')  
78 - File.read(hook_path) if File.exists?(hook_path)  
79 - end  
80 - end  
81 -  
82 # Returns an Array of branch names 63 # Returns an Array of branch names
83 def branch_names 64 def branch_names
84 repo.branches.collect(&:name).sort 65 repo.branches.collect(&:name).sort
app/views/admin/projects/show.html.haml
@@ -4,24 +4,6 @@ @@ -4,24 +4,6 @@
4 %i.icon-edit 4 %i.icon-edit
5 Edit 5 Edit
6 6
7 -- if @repository && @repository.has_commits?  
8 - - if !@repository.has_post_receive_file?  
9 - %br  
10 - .alert.alert-error  
11 - %span  
12 - %strong Project has commits but missing post-receive file.  
13 - %br  
14 - If you exported project manually - make a link of post-receive hook file from gitolite to project repository  
15 - - elsif !@repository.valid_post_receive_file?  
16 - %br  
17 - .alert.alert-error  
18 - %span  
19 - %strong Project has invalid post-receive file.  
20 - %br  
21 - 1. Make sure your gitolite instace has latest post-receive file.  
22 - %br  
23 - 2. Make a link of post-receive hook file from gitolite to project repository  
24 -  
25 7
26 %br 8 %br
27 %table.zebra-striped 9 %table.zebra-striped
@@ -103,12 +85,6 @@ @@ -103,12 +85,6 @@
103 Last commit at: 85 Last commit at:
104 %td 86 %td
105 = last_commit(@project) 87 = last_commit(@project)
106 - %tr  
107 - %td  
108 - %b  
109 - Post Receive File:  
110 - %td  
111 - = check_box_tag :post_receive_file, 1, @repository.has_post_receive_file?, disabled: true  
112 88
113 %br 89 %br
114 %h5 90 %h5