Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc git hosting fixes #162

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/views/gitolite_public_keys/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h2><%= link_to l(:label_public_keys), public_keys_path %> &#187; <%= h @gitolite_public_key %></h2>
<h2><%= link_to l(:label_public_keys), :controller=> "my", :action => "account" %> &#187; <%= h @gitolite_public_key %></h2>

<%= error_messages_for :gitolite_public_key %>

Expand Down
8 changes: 5 additions & 3 deletions lib/git_hosting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ def self.move_repository(old_name, new_name)
end

@@recursionCheck = false
@@projects_so_far= []
def self.update_repositories(projects, is_repo_delete)


Expand All @@ -356,13 +357,14 @@ def self.update_repositories(projects, is_repo_delete)

logger.debug "Updating repositories..."
projects = (projects.is_a?(Array) ? projects : [projects])


@@projects_so_far.each { |p| logger.info p.name }
projects= projects.select{|p| !@@projects_so_far.include?(p) }

# Don't bother doing anything if none of the projects we've been handed have a Git repository
unless projects.detect{|p| p.repository.is_a?(Repository::Git) }.nil?



#lock
if !lock(5)
@@recursionCheck = false
Expand All @@ -383,7 +385,7 @@ def self.update_repositories(projects, is_repo_delete)
changed = false

projects.select{|p| p.repository.is_a?(Repository::Git)}.each do |project|

@@projects_so_far << project
repo_name = repository_name(project)

#check for delete -- if delete we can just
Expand Down
6 changes: 6 additions & 0 deletions lib/git_hosting/patches/git_adapter_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def self.included(base)
unloadable
end

base.send(:alias_method_chain, :entries, :entry_caching)
begin
base.send(:alias_method_chain, :scm_cmd, :sudo)
rescue Exception =>e
Expand Down Expand Up @@ -34,6 +35,11 @@ def client_command_with_sudo
end
end

def entries_with_entry_caching(path=nil, identifier=nil)
return @entries if @entries
@entries= entries_without_entry_caching(path, identifier)
@entries
end

def scm_cmd_with_sudo(*args, &block)

Expand Down