mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-22 19:16:39 +10:00
Merge branch 'bozaro-empty-repo'
This commit is contained in:
@@ -10,6 +10,7 @@ v 8.2.0 (unreleased)
|
||||
- Adds ability to remove the forked relationship from project settings screen. (Han Loong Liauw)
|
||||
- Improved performance of sorting milestone issues
|
||||
- Allow users to select the Files view as default project view (Cristian Bica)
|
||||
- Show "Empty Repository Page" for repository without branches (Artem V. Navrotskiy)
|
||||
|
||||
v 8.1.0 (unreleased)
|
||||
- Send an email to admin email when a user is reported for spam (Jonathan Rochkind)
|
||||
|
||||
@@ -567,7 +567,7 @@ class Project < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def empty_repo?
|
||||
!repository.exists? || repository.empty?
|
||||
!repository.exists? || !repository.has_visible_content?
|
||||
end
|
||||
|
||||
def repo
|
||||
|
||||
@@ -44,6 +44,19 @@ class Repository
|
||||
raw_repository.empty?
|
||||
end
|
||||
|
||||
#
|
||||
# Git repository can contains some hidden refs like:
|
||||
# /refs/notes/*
|
||||
# /refs/git-as-svn/*
|
||||
# /refs/pulls/*
|
||||
# This refs by default not visible in project page and not cloned to client side.
|
||||
#
|
||||
# This method return true if repository contains some content visible in project page.
|
||||
#
|
||||
def has_visible_content?
|
||||
!raw_repository.branches.empty?
|
||||
end
|
||||
|
||||
def commit(id = 'HEAD')
|
||||
return nil unless raw_repository
|
||||
commit = Gitlab::Git::Commit.find(raw_repository, id)
|
||||
|
||||
Reference in New Issue
Block a user