Skip to content

Commit fb5af24

Browse files
rootNicolas
root
authored and
Nicolas
committed
Better test of repository emptyness
1 parent 106dbf0 commit fb5af24

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/redmine_git_hosting/patches/repositories_controller_patch.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def self.included(base)
2121
module InstanceMethods
2222

2323
def show_with_git_hosting(&block)
24-
if @repository.is_a?(Repository::Git) and @rev.blank?
24+
if @repository.is_a?(Repository::Git) && @repository.empty?
2525
# Fake list of repos
2626
@repositories = @project.gitolite_repos
2727
render :action => 'git_instructions'

lib/redmine_git_hosting/patches/repository_git_patch.rb

+9
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,15 @@ def gitolite_hook_key
366366
end
367367

368368

369+
def empty?
370+
if extra_info.nil? || !extra_info.has_key?('heads')
371+
return true
372+
else
373+
return false
374+
end
375+
end
376+
377+
369378
private
370379

371380

0 commit comments

Comments
 (0)