Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove trailing whitespace on all files

  • Loading branch information...
commit f2f97ed494cc1457c699d2dff5ee53e41d4e9f48 1 parent 60b52c5
IceArmy authored
Showing with 116 additions and 116 deletions.
  1. +18 −18 app/controllers/git_http_controller.rb
  2. +2 −2 app/controllers/gitolite_hooks_controller.rb
  3. +6 −6 app/controllers/gitolite_public_keys_controller.rb
  4. +2 −2 app/helpers/gitolite_public_keys_helper.rb
  5. +4 −4 app/models/git_hosting_settings_observer.rb
  6. +8 −8 app/models/gitolite_public_key.rb
  7. +1 −1  app/models/repository_mirror.rb
  8. +1 −1  app/views/gitolite_public_keys/edit.html.erb
  9. +7 −7 app/views/my/account.rhtml
  10. +4 −4 app/views/projects/_git_urls.erb
  11. +15 −15 app/views/projects/settings/_repository.rhtml
  12. +4 −4 app/views/repositories/_git_urls.erb
  13. +3 −3 app/views/repositories/_navigation.rhtml
  14. +2 −2 app/views/repositories/git_instructions.html.erb
  15. +2 −2 app/views/settings/_redmine_git_hosting.html.erb
  16. +1 −1  assets/stylesheets/git_url_display.css
  17. +2 −2 contrib/hooks/post-receive.redmine_gitolite.rb
  18. +7 −7 db/migrate/20091119162426_set_mirror_role_permissions.rb
  19. +1 −1  db/migrate/20091119162428_create_git_caches.rb
  20. +6 −6 db/migrate/2011081300000_create_git_repository_extras.rb
  21. +3 −3 init.rb
  22. +1 −1  lib/git_hosting.rb
  23. +3 −3 lib/git_hosting/patches/groups_controller_patch.rb
  24. +7 −7 lib/git_hosting/patches/repositories_controller_patch.rb
  25. +2 −2 lib/git_hosting/patches/repository_patch.rb
  26. +4 −4 lib/gitolite_conf.rb
36 app/controllers/git_http_controller.rb
View
@@ -13,10 +13,10 @@ def index
p2 = params[:p2]
p3 = params[:p3]
proj_id = params[:id]
-
-
+
+
@git_http_repo_path = (params[:path]).gsub(/\.git$/, "")
-
+
reqfile = p2 == "" ? p1 : ( p3 == "" ? p1 + "/" + p2 : p1 + "/" + p2 + "/" + p3);
if p1 == "git-upload-pack"
@@ -48,19 +48,19 @@ def index
private
def authenticate
- is_push = params[:p1] == "git-receive-pack"
+ is_push = params[:p1] == "git-receive-pack"
query_valid = false
authentication_valid = true
-
+
project = Project.find(params[:id])
repository = project != nil ? project.repository : nil
- if(project != nil && repository !=nil)
+ if(project != nil && repository !=nil)
if repository.extra[:git_http] == 2 || (repository.extra[:git_http] == 1 && is_ssl?)
query_valid = true
- allow_anonymous_read = project.is_public
+ allow_anonymous_read = project.is_public
if is_push || (!allow_anonymous_read)
authentication_valid = false
- authenticate_or_request_with_http_basic do |login, password|
+ authenticate_or_request_with_http_basic do |login, password|
user = User.find_by_login(login);
if user.is_a?(User)
if user.allowed_to?( :commit_access, project ) || ((!is_push) && user.allowed_to?( :view_changesets, project ))
@@ -74,7 +74,7 @@ def authenticate
end
#if authentication failed, error already rendered
- #so, just render case where user queried a project
+ #so, just render case where user queried a project
#that's nonexistant or for which smart http isn't active
if !query_valid
render_not_found
@@ -90,8 +90,8 @@ def service_rpc(rpc)
command = git_command("#{rpc} --stateless-rpc .")
@git_http_control_pipe = IO.popen(command, File::RDWR)
@git_http_control_pipe.write(input)
-
- render :text => proc { |response, output|
+
+ render :text => proc { |response, output|
buf_length=131072
buf = @git_http_control_pipe.read(buf_length)
while(buf.length == buf_length)
@@ -108,13 +108,13 @@ def service_rpc(rpc)
def get_info_refs(reqfile)
service_name = get_service_type
- if service_name
+ if service_name
cmd = git_command("#{service_name} --stateless-rpc --advertise-refs .")
refs = %x[#{cmd}]
response.headers["Content-Type"] = "application/x-git-%s-advertisement" % service_name
hdr_nocache
-
+
response_data = pkt_write("# service=git-#{service_name}\n") + pkt_flush + refs
render :text=>response_data
else
@@ -167,14 +167,14 @@ def get_text_file(reqfile)
# some of this borrowed from the Rack::File implementation
def internal_send_file(reqfile, content_type)
-
+
response.headers["Content-Type"] = content_type
if !file_exists(reqfile)
- return render_not_found
+ return render_not_found
else
command = "#{run_git_prefix()} dd if=#{reqfile} '"
@git_http_control_pipe = IO.popen(command, File::RDWR)
- render :text => proc { |response, output|
+ render :text => proc { |response, output|
buf_length=131072
buf = @git_http_control_pipe.read(buf_length)
while(buf.length == buf_length)
@@ -191,7 +191,7 @@ def internal_send_file(reqfile, content_type)
end
def file_exists(reqfile)
-
+
cmd="#{run_git_prefix()} if [ -e \"#{reqfile}\" ] ; then echo found ; else echo bad ; fi ' "
is_found=%x[#{cmd}]
is_found.chomp!
@@ -241,7 +241,7 @@ def git_command(command)
return "#{run_git_prefix()} env GL_BYPASS_UPDATE_HOOK=true git #{command} '"
end
-
+
#note command needs to be terminated with a quote!
def run_git_prefix
return "#{GitHosting::git_user_runner()} 'cd #{Setting.plugin_redmine_git_hosting['gitRepositoryBasePath']}/#{@git_http_repo_path}.git ; "
4 app/controllers/gitolite_hooks_controller.rb
View
@@ -39,9 +39,9 @@ def post_receive
GitHosting.logger.debug "Pushing changes to mirror #{mirror.url}"
output.write("Pushing changes to mirror #{mirror.url} ... ")
output.flush
-
+
mirror_err = mirror.push
-
+
result = mirror_err.length > 0 ? "Failed!\n" + mirror_err : "Done\n"
output.write(result)
output.flush
12 app/controllers/gitolite_public_keys_controller.rb
View
@@ -1,11 +1,11 @@
class GitolitePublicKeysController < ApplicationController
unloadable
-
+
before_filter :require_login
before_filter :set_user_variable
before_filter :find_gitolite_public_key, :except => [:index, :new, :create]
-
+
def edit
end
@@ -23,7 +23,7 @@ def update
render :action => 'edit'
end
end
-
+
def create
@gitolite_public_key = GitolitePublicKey.new(params[:public_key].merge(:user => @user))
if @gitolite_public_key.save
@@ -33,13 +33,13 @@ def create
end
redirect_to url_for(:controller => 'my', :action => 'account')
end
-
+
protected
-
+
def set_user_variable
@user = User.current
end
-
+
def find_gitolite_public_key
key = GitolitePublicKey.find_by_id(params[:id])
if key and key.user == @user
4 app/helpers/gitolite_public_keys_helper.rb
View
@@ -1,9 +1,9 @@
module GitolitePublicKeysHelper
def gitolite_public_keys_status_options_for_select(user, selected)
key_count_by_active = user.gitolite_public_keys.count(:group => 'active').to_hash
- options_for_select([[l(:label_all), nil],
+ options_for_select([[l(:label_all), nil],
["#{l(:status_active)} (#{key_count_by_active[true].to_i})", GitolitePublicKey::STATUS_ACTIVE],
["#{l(:status_locked)} (#{key_count_by_active[false].to_i})", GitolitePublicKey::STATUS_LOCKED]], selected)
end
-
+
end
8 app/models/git_hosting_settings_observer.rb
View
@@ -18,9 +18,9 @@ def reload_this_observer
def after_save(object)
if object.name == "plugin_redmine_git_hosting"
-
+
%x[ rm -rf '#{ GitHosting.get_tmp_dir }' ]
-
+
if @@old_repo_base != object.value['gitRepositoryBasePath']
GitHostingObserver.set_update_active(false)
all_projects = Project.find(:all)
@@ -36,11 +36,11 @@ def after_save(object)
GitHostingObserver.set_update_active(true)
end
- if @@old_git_user != object.value['gitUser']
+ if @@old_git_user != object.value['gitUser']
GitHosting.setup_hooks
GitHosting.update_repositories( Project.find(:all), false)
-
+
elsif @@old_http_server != object.value['httpServer'] || @@old_hook_debug != object.value['gitHooksDebug'] || @@old_repo_base != object.value['gitRepositoryBasePath']
GitHosting.update_global_hook_params
16 app/models/gitolite_public_key.rb
View
@@ -6,14 +6,14 @@ class GitolitePublicKey < ActiveRecord::Base
validates_uniqueness_of :title, :scope => :user_id
validates_uniqueness_of :identifier, :score => :user_id
validates_presence_of :title, :key, :identifier
-
+
named_scope :active, {:conditions => {:active => GitolitePublicKey::STATUS_ACTIVE}}
named_scope :inactive, {:conditions => {:active => GitolitePublicKey::STATUS_LOCKED}}
-
+
validate :has_not_been_changed
-
+
before_validation :set_identifier
-
+
def has_not_been_changed
unless new_record?
%w(identifier key user_id).each do |attribute|
@@ -21,15 +21,15 @@ def has_not_been_changed
end
end
end
-
+
def set_identifier
- # add "redmine_" as a prefix to the username, and then the current date
+ # add "redmine_" as a prefix to the username, and then the current date
# this helps ensure uniqueness of each key identifier
#
- # also, it ensures that it is very, very unlikely to conflict with any
+ # also, it ensures that it is very, very unlikely to conflict with any
# existing key name if gitolite config is also being edited manually
self.identifier ||= "redmine_#{self.user.login.underscore}_#{Time.now.to_i.to_s}_#{Time.now.usec.to_s}".gsub(/[^0-9a-zA-Z@\-\.]/,'_')
end
-
+
def to_s ; title ; end
end
2  app/models/repository_mirror.rb
View
@@ -20,7 +20,7 @@ def push
repo_path = GitHosting.repository_path(project)
shellout = %x[ echo 'cd "#{repo_path}" ; env GIT_SSH=~/.ssh/run_gitolite_admin_ssh git push --mirror "#{url}" 2>&1' | #{GitHosting.git_user_runner} "bash" ]
push_failed = ($?.to_i!=0) ? true : false
-
+
err_output = push_failed ? "" : ""
if push_failed
ms = " #{mirror.url} push error "
2  app/views/gitolite_public_keys/edit.html.erb
View
@@ -3,7 +3,7 @@
<%= error_messages_for :gitolite_public_key %>
<% form_for :public_key, @gitolite_public_key, :url => { :action => "update" }, :html => { :method => :put},
- :builder => TabularFormBuilder,
+ :builder => TabularFormBuilder,
:lang => current_language do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
14 app/views/my/account.rhtml
View
@@ -7,8 +7,8 @@
<%= error_messages_for :gitolite_public_key %>
<div class="splitcontentleft">
- <% form_for :user, @user, :url => { :action => "account" },
- :builder => TabularFormBuilder,
+ <% form_for :user, @user, :url => { :action => "account" },
+ :builder => TabularFormBuilder,
:lang => current_language,
:html => { :id => 'my_account_form' } do |f| %>
<div class="box">
@@ -26,15 +26,15 @@
<% end %>
<%= call_hook(:view_my_account, :user => @user, :form => f) %>
</div>
-
+
<h4><%=l(:field_mail_notification)%></h4>
<%= render :partial => 'users/mail_notifications' %>
-
+
<div class="tabular">
<h4><%=l(:label_preferences)%></h4>
<%= render :partial => 'users/preferences' %>
</div>
-
+
<%= submit_tag l(:button_save) %>
</div>
<% end %>
@@ -61,7 +61,7 @@
</tr>
<% end %>
</table>
-
+
<div class="box">
<h4><%=l(:label_public_key_new)%></h4>
<% form_for :public_key, @gitolite_public_key, :url => { :controller => 'gitolite_public_keys', :action => "create" }, :builder => TabularFormBuilder, :lang => current_language do |f| %>
@@ -74,7 +74,7 @@
<%= submit_tag l(:button_create) %>
<% end %>
</div>
-</div>
+</div>
<% content_for :sidebar do %>
<%= render :partial => 'sidebar' %>
8 app/views/projects/_git_urls.erb
View
@@ -1,12 +1,12 @@
<% if @project.repository && @project.repository.is_a?(Repository::Git) %>
<% content_for :header_tags do %>
-
+
<%= stylesheet_link_tag('git_url_display', :plugin => 'redmine_git_hosting') %>
<%= javascript_include_tag('ZeroClipboard', :plugin => 'redmine_git_hosting') %>
<%= javascript_include_tag('git_url_display', :plugin => 'redmine_git_hosting') %>
-
+
<script type="text/javascript">
-
+
guProjectName= "<%= (@project.parent ? GitHosting::get_full_parent_path(@project, false) + "/" : "" ) %>" + "<%= @project.repository.url %>".replace(/^.*\//, "")
guProjectIsPublic= <%= project.is_public.to_s %> ;
guUser= "<%= User.current.login %>"
@@ -15,7 +15,7 @@
guGitServer="<%= Setting.plugin_redmine_git_hosting['gitServer'] %>"
guHttpBase="<%= Setting.plugin_redmine_git_hosting['httpServer'] %>".replace(/\/$/, "")
guHttpProto="<%= project.repository.extra[:git_http].to_s == "2" ? "http" : "https" %>"
-
+
window.onload = setGitUrlOnload
ZeroClipboard.setMoviePath('<%= image_path('ZeroClipboard.swf', :plugin => 'redmine_git_hosting') %>');
30 app/views/projects/settings/_repository.rhtml
View
@@ -2,13 +2,13 @@
<%= error_messages_for 'repository' %>
<div class="splitcontentleft">
- <div class="box tabular">
+ <div class="box tabular">
<% if @repository && @repository.is_a?(Repository::Git) && GitHostingHelper.can_view_mirrors(@repository.project) %>
<h3>Repository Options</h3>
<% end %>
-
+
<p><%= label_tag('repository_scm', l(:label_scm)) %><%= scm_select_tag(@repository) %></p>
-
+
<% if @repository && @repository.is_a?(Repository::Git) %>
<%
mirror_pubkey = GitHosting.mirror_push_public_key
@@ -23,15 +23,15 @@
end
end
%>
- <p>
+ <p>
<%= label_tag "extra[git_daemon]", l(:field_git_daemon) %>
<%= select_tag "extra[git_daemon]", options_for_select([ [l(:label_disabled), "0"], [l(:label_enabled), "1"]], :selected=>extra_vals[:git_daemon]) %>
</p>
- <p>
+ <p>
<%= label_tag "extra[git_http]", l(:field_git_http) %>
<%= select_tag "extra[git_http]", options_for_select([ [l(:label_disabled), "0"], [l(:label_https_only), "1"], [l(:label_https_and_http), "2"] ], :selected=>extra_vals[:git_http]) %>
</p>
- <p>
+ <p>
<%= label_tag "extra[notify_cia]", l(:field_notify_cia) %>
<%= select_tag "extra[notify_cia]", options_for_select([ [l(:label_disabled), "0"], [l(:label_enabled), "1"]], :selected=>extra_vals[:notify_cia]) %>
<% if extra_vals[:notify_cia] == "1" %>
@@ -52,24 +52,24 @@
<% end %>
</div>
<%= submit_tag((@repository.nil? || @repository.new_record?) ? l(:button_create) : l(:button_save), :disabled => @repository.nil?) %>
- </div>
+ </div>
<% if @repository && @repository.is_a?(Repository::Git) && GitHostingHelper.can_view_mirrors(@repository.project) %>
<!-- <div id="mirror_top_spacer" style="display:block;height:25px;clear:both;"></div> -->
-
-
+
+
<%= stylesheet_link_tag('application', :plugin => 'redmine_git_hosting') %>
<%= stylesheet_link_tag('modalbox/modalbox', :plugin => 'redmine_git_hosting') %>
<%= javascript_include_tag('modalbox/lib/builder', :plugin => 'redmine_git_hosting') %>
<%= javascript_include_tag('modalbox/modalbox', :plugin => 'redmine_git_hosting') %>
-
+
<div class="splitcontentright">
<div class="box tabular">
-
+
<h3>Repository Mirrors</h3>
-
+
<% if GitHostingHelper.can_create_mirrors(@repository.project) %>
<div style="left:0px;clear:left;margin: 4px 5px;width: 96%;">
<%= link_to("Add Repository Mirror", url_for(:controller => 'repository_mirrors', :action => 'create', :project_id => repository.project.identifier), :class => 'icon icon-add add-mirror' ) %>
@@ -112,10 +112,10 @@
<span>Mirrors Must Grant Write Access To The Following Public Key:</span>
<br/>
<textarea cols="40" id="mirror_pubkey" readonly="readonly" rows="20" style="height:140px;width:96%"><%= mirror_pubkey %></textarea>
- </div>
-
+ </div>
+
<div id="mirror_bottom_spacer" style="display:block;height:10px;clear:both;"></div>
-
+
</div>
</div>
<script type="text/javascript">
8 app/views/repositories/_git_urls.erb
View
@@ -1,12 +1,12 @@
<% if @project.repository && @project.repository.is_a?(Repository::Git) && Setting.plugin_redmine_git_hosting['gitRepositoriesShowUrl'].to_s != "false" %>
<% content_for :header_tags do %>
-
+
<%= stylesheet_link_tag('git_url_display', :plugin => 'redmine_git_hosting') %>
<%= javascript_include_tag('ZeroClipboard', :plugin => 'redmine_git_hosting') %>
<%= javascript_include_tag('git_url_display', :plugin => 'redmine_git_hosting') %>
-
+
<script type="text/javascript">
-
+
guProjectName= "<%= (@project.parent ? GitHosting::get_full_parent_path(@project, false) + "/" : "" ) %>" + "<%= @project.repository.url %>".replace(/^.*\//, "")
guProjectIsPublic= <%= project.is_public.to_s %> ;
guUser= "<%= User.current.login %>"
@@ -15,7 +15,7 @@
guGitServer="<%= Setting.plugin_redmine_git_hosting['gitServer'] %>"
guHttpBase="<%= Setting.plugin_redmine_git_hosting['httpServer'] %>".replace(/\/$/, "")
guHttpProto="<%= project.repository.extra[:git_http].to_s == "2" ? "http" : "https" %>"
-
+
window.onload = setGitUrlOnload
ZeroClipboard.setMoviePath('<%= image_path('ZeroClipboard.swf', :plugin => 'redmine_git_hosting') %>');
6 app/views/repositories/_navigation.rhtml
View
@@ -7,15 +7,15 @@
<% form_tag({:action => controller.action_name, :id => @project, :path => to_path_param(@path), :rev => ''}, {:method => :get, :id => 'revision_selector'}) do -%>
<!-- Branches Dropdown -->
<% if !@repository.branches.nil? && @repository.branches.length > 0 -%>
- | <%= l(:label_branch) %>:
+ | <%= l(:label_branch) %>:
<%= select_tag :branch, options_for_select([] + @repository.branches,@rev), :id => 'branch' %>
<% end -%>
<% if !@repository.tags.nil? && @repository.tags.length > 0 -%>
- | <%= l(:label_tag) %>:
+ | <%= l(:label_tag) %>:
<%= select_tag :tag, options_for_select([] + @repository.tags,@rev), :id => 'tag' %>
<% end -%>
- | <%= l(:label_revision) %>:
+ | <%= l(:label_revision) %>:
<%= text_field_tag 'rev', @rev, :size => 8 %>
<% end -%>
4 app/views/repositories/git_instructions.html.erb
View
@@ -3,7 +3,7 @@
<% git_ssh_url = Setting.plugin_redmine_git_hosting['gitUser'] + "@" + Setting.plugin_redmine_git_hosting['gitServer'] + ":" + GitHosting.repository_name(@project) + '.git' %>
<div class="box">
-
+
<h2>Git Setup:</h2>
<pre> <a href="http://git-scm.com/download" target="_blank">Download and Install Git</a>
git config --global user.name "<%= User.current.name(:firstname_lastname) %>"
@@ -23,5 +23,5 @@
<pre> cd existing_git_repo
git remote add origin <%= git_ssh_url %>
git push -u origin master
-</pre>
+</pre>
</div>
4 app/views/settings/_redmine_git_hosting.html.erb
View
@@ -36,7 +36,7 @@
<%= text_field_tag("settings[gitoliteIdentityFile]", @settings['gitoliteIdentityFile'], :size => 60) %>
<br />
</p>
-
+
<p>
<label><%= l(:label_gitolite_identity_public_key_file)%></label>
<%= text_field_tag("settings[gitoliteIdentityPublicKeyFile]", @settings['gitoliteIdentityPublicKeyFile'], :size => 60) %>
@@ -82,7 +82,7 @@
<br/>
<h3><%= l(:label_git_hook_header)%></h3>
-
+
<p>
<label><%= l(:label_git_hooks_are_asynchronous)%></label>
<%= select_tag("settings[gitHooksAreAsynchronous]", options_for_select([[l(:label_enabled), 'true'], [l(:label_disabled), 'false']], @settings['gitHooksAreAsynchronous'])) %>
2  assets/stylesheets/git_url_display.css
View
@@ -24,7 +24,7 @@
}
-#git_url_list
+#git_url_list
{
height: 23px;
float: left;
4 contrib/hooks/post-receive.redmine_gitolite.rb
View
@@ -11,7 +11,7 @@
def log(msg, debug_only=false, with_newline=true)
if $debug || (!debug_only)
- print msg + (with_newline ? "\n" : "")
+ print msg + (with_newline ? "\n" : "")
end
end
def get_git_repository_config(varname)
@@ -28,7 +28,7 @@ def get_http_params(rgh_vars)
params
end
-def run_query(url_str, params, with_https)
+def run_query(url_str, params, with_https)
url_str = (with_https ? "https://" : "http://" ) + url_str.gsub(/^http[s]*:\/\//, "")
success = false
begin
14 db/migrate/20091119162426_set_mirror_role_permissions.rb
View
@@ -1,7 +1,7 @@
class SetMirrorRolePermissions < ActiveRecord::Migration
def self.up
-
- begin
+
+ begin
GitHostingObserver.set_update_active(false)
manager_role = Role.find_by_name(I18n.t(:default_role_manager))
@@ -9,26 +9,26 @@ def self.up
manager_role.add_permission! :edit_repository_mirrors
manager_role.add_permission! :create_repository_mirrors
manager_role.save
-
+
developer_role = Role.find_by_name(I18n.t(:default_role_developer))
developer_role.add_permission! :view_repository_mirrors
developer_role.save
rescue
end
-
+
end
def self.down
-
+
begin
GitHostingObserver.set_update_active(false)
-
+
manager_role = Role.find_by_name(I18n.t(:default_role_manager))
manager_role.remove_permission! :view_repository_mirrors
manager_role.remove_permission! :edit_repository_mirrors
manager_role.remove_permission! :create_repository_mirrors
manager_role.save
-
+
developer_role = Role.find_by_name(I18n.t(:default_role_developer))
developer_role.remove_permission! :view_repository_mirrors
developer_role.save
2  db/migrate/20091119162428_create_git_caches.rb
View
@@ -5,7 +5,7 @@ def self.up
t.column :command_output, :binary
t.column :proj_identifier, :string
t.timestamps
- t.index :command
+ t.index :command
end
end
12 db/migrate/2011081300000_create_git_repository_extras.rb
View
@@ -13,11 +13,11 @@ def self.up
t.column :key, :string
end
-
- GitHostingObserver.set_update_active(false)
+
+ GitHostingObserver.set_update_active(false)
Project.find(:all).each do |project|
if project.repository.is_a?(Repository::Git)
-
+
#create extra object
e = GitRepositoryExtra.new()
begin
@@ -41,18 +41,18 @@ def self.up
end
end
-
+
# this next part requires running commands as git user
# use a begin/rescue block because this could easily bomb out
# if settings aren't correct to begin with
begin
%x[ rm -rf '#{ GitHosting.get_tmp_dir }' ]
GitHosting.setup_hooks
- GitHostingObserver.set_update_active(false)
+ GitHostingObserver.set_update_active(false)
rescue
end
- # even if git commands above didn't work properly, attempt to
+ # even if git commands above didn't work properly, attempt to
# eliminate tmp dir in case they partially worked, and we have
# residual crap belonging to wrong user
begin
6 init.rb
View
@@ -69,13 +69,13 @@ class GitRepoUrlHook < Redmine::Hook::ViewListener
if config.action_controller.perform_caching
ActiveRecord::Base.observers = ActiveRecord::Base.observers << GitHostingObserver
ActiveRecord::Base.observers = ActiveRecord::Base.observers << GitHostingSettingsObserver
-
+
ActionController::Dispatcher.to_prepare(:git_hosting_observer_reload) do
GitHostingObserver.instance.reload_this_observer
- end
+ end
ActionController::Dispatcher.to_prepare(:git_hosting_settings_observer_reload) do
GitHostingSettingsObserver.instance.reload_this_observer
- end
+ end
end
end
2  lib/git_hosting.rb
View
@@ -31,7 +31,7 @@ def self.git_user
@@mirror_pubkey = nil
def self.mirror_push_public_key
if @@mirror_pubkey.nil?
-
+
%x[cat '#{Setting.plugin_redmine_git_hosting['gitoliteIdentityFile']}' | #{GitHosting.git_user_runner} 'cat > ~/.ssh/gitolite_admin_id_rsa ' ]
%x[cat '#{Setting.plugin_redmine_git_hosting['gitoliteIdentityPublicKeyFile']}' | #{GitHosting.git_user_runner} 'cat > ~/.ssh/gitolite_admin_id_rsa.pub ' ]
%x[ #{GitHosting.git_user_runner} 'chmod 600 ~/.ssh/gitolite_admin_id_rsa' ]
6 lib/git_hosting/patches/groups_controller_patch.rb
View
@@ -2,15 +2,15 @@
module GitHosting
module Patches
module GroupsControllerPatch
-
+
@@original_projects = []
def disable_git_observer_updates
GitHostingObserver.set_update_active(false)
end
-
+
def do_single_update
- GitHostingObserver.set_update_active(true)
+ GitHostingObserver.set_update_active(true)
end
14 lib/git_hosting/patches/repositories_controller_patch.rb
View
@@ -17,10 +17,10 @@ def edit_with_scm_settings
repo_name= @project.parent ? File.join(GitHosting::get_full_parent_path(@project, true),@project.identifier) : @project.identifier
params[:repository][:url] = File.join(Setting.plugin_redmine_git_hosting['gitRepositoryBasePath'], "#{repo_name}.git")
end
-
+
if params[:repository_scm] == "Git" || @project.repository.is_a?(Repository::Git)
#Evidently the ONLY way to update the repository.extra table is to basically copy/paste the existing controller code
- #the update line needs to go in the dead center of it.
+ #the update line needs to go in the dead center of it.
@repository = @project.repository
if !@repository
@repository = Repository.factory(params[:repository_scm])
@@ -33,7 +33,7 @@ def edit_with_scm_settings
end
@repository.save
end
-
+
render(:update) do |page|
page.replace_html "tab-content-repository", :partial => 'projects/settings/repository'
@@ -42,15 +42,15 @@ def edit_with_scm_settings
page.replace_html "main-menu", render_main_menu(@project)
end
end
-
+
GitHosting.update_repositories(@project, false) if !@project.repository.nil?
GitHosting.setup_hooks(@project) if !@project.repository.nil?
-
+
else
edit_without_scm_settings
end
-
-
+
+
end
def self.included(base)
4 lib/git_hosting/patches/repository_patch.rb
View
@@ -27,7 +27,7 @@ def factory_with_git_extra_init(klass_name, *args)
return new_repo
end
end
-
+
def self.included(base)
base.extend(ClassMethods)
@@ -37,7 +37,7 @@ class << self
alias_method_chain :factory, :git_extra_init
end
end
-
+
end
end
end
8 lib/gitolite_conf.rb
View
@@ -42,7 +42,7 @@ def rename_repo old_name, new_name
def changed?
@original_content != content
end
-
+
def all_repos
repos={}
@repositories.each do |repo, rights|
@@ -80,7 +80,7 @@ def repository repo_name
def content
content = []
-
+
# To facilitate creation of repos, even when no users are defined
# always define at least one user -- specifically the admin
# user which has rights to modify gitolite-admin and control
@@ -112,7 +112,7 @@ class GitoliteAccessRights
def initialize
@rights = ActiveSupport::OrderedHash.new
end
-
+
def rights
@rights
end
@@ -129,7 +129,7 @@ def set perm, users
add perm, users
end
- def each
+ def each
@rights.each {|k,v| yield k, v}
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.