diff --git a/app/controllers/projects/git/trees_controller.rb b/app/controllers/projects/git/trees_controller.rb index e3d415a8a..775275318 100644 --- a/app/controllers/projects/git/trees_controller.rb +++ b/app/controllers/projects/git/trees_controller.rb @@ -4,7 +4,7 @@ class Projects::Git::TreesController < Projects::Git::BaseController skip_before_filter :set_branch_and_tree, :set_treeish_and_path, :only => :archive def show - render('empty') and return if @project.empty? + render('empty') and return if @project.is_empty? @tree = @tree / @path if @path.present? @commit = @branch.present? ? @branch.commit() : @project.repo.log(@treeish, @path, :max_count => 1).first raise Grit::NoSuchPathError unless @commit diff --git a/lib/modules/models/git.rb b/lib/modules/models/git.rb index 04b7dc6d6..9ba347403 100644 --- a/lib/modules/models/git.rb +++ b/lib/modules/models/git.rb @@ -97,7 +97,7 @@ module Modules system("#{Rails.root.join('bin', 'import_srpm.sh')} #{opts} >> /dev/null 2>&1") end - def empty? + def is_empty? repo.branches.count == 0 end