Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
517b08d00044
Commit
517b08d0
authored
Oct 20, 2015
by
Artem V. Navrotskiy
Browse files
Show empty repository page if repository don't have branches
parent
c6f07c5a6321
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
517b08d0
...
...
@@ -88,6 +88,7 @@
- Correct lookup-by-email for LDAP logins
- Fix loading spinner sometimes not being hidden on Merge Request tab switches
- Animate the logo on hover
- Show "Empty Repository Page" for repository without branches (#9728)
v 8.0.4
- Fix Message-ID header to be RFC 2111-compliant to prevent e-mails being dropped (Stan Hu)
...
...
app/models/project.rb
View file @
517b08d0
...
...
@@ -567,7 +567,7 @@
end
def
empty_repo?
!
repository
.
exists?
||
repository
.
empty
?
!
repository
.
exists?
||
!
repository
.
has_visible_content
?
end
def
repo
...
...
app/models/repository.rb
View file @
517b08d0
...
...
@@ -44,6 +44,19 @@
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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment