Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
573d0989
Commit
573d0989
authored
Apr 28, 2017
by
Kim "BKC" Carlbäcker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup
parent
a998710a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
app/models/repository.rb
app/models/repository.rb
+1
-3
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+5
-0
No files found.
app/models/repository.rb
View file @
573d0989
...
@@ -505,10 +505,8 @@ class Repository
...
@@ -505,10 +505,8 @@ class Repository
delegate
:tag_names
,
to: :raw_repository
delegate
:tag_names
,
to: :raw_repository
cache_method
:tag_names
,
fallback:
[]
cache_method
:tag_names
,
fallback:
[]
delegate
:branch_count
,
to: :raw_repository
delegate
:branch_count
,
:tag_count
,
to: :raw_repository
cache_method
:branch_count
,
fallback:
0
cache_method
:branch_count
,
fallback:
0
delegate
:tag_count
,
to: :raw_repository
cache_method
:tag_count
,
fallback:
0
cache_method
:tag_count
,
fallback:
0
def
avatar
def
avatar
...
...
spec/models/repository_spec.rb
View file @
573d0989
...
@@ -1379,7 +1379,10 @@ describe Repository, models: true do
...
@@ -1379,7 +1379,10 @@ describe Repository, models: true do
describe
'#branch_count'
do
describe
'#branch_count'
do
it
'returns the number of branches'
do
it
'returns the number of branches'
do
expect
(
repository
.
branch_count
).
to
be_an
(
Integer
)
expect
(
repository
.
branch_count
).
to
be_an
(
Integer
)
# NOTE: Until rugged goes away, make sure rugged and gitaly are in sync
rugged_count
=
repository
.
raw_repository
.
rugged
.
branches
.
count
rugged_count
=
repository
.
raw_repository
.
rugged
.
branches
.
count
expect
(
repository
.
branch_count
).
to
eq
(
rugged_count
)
expect
(
repository
.
branch_count
).
to
eq
(
rugged_count
)
end
end
end
end
...
@@ -1387,8 +1390,10 @@ describe Repository, models: true do
...
@@ -1387,8 +1390,10 @@ describe Repository, models: true do
describe
'#tag_count'
do
describe
'#tag_count'
do
it
'returns the number of tags'
do
it
'returns the number of tags'
do
expect
(
repository
.
tag_count
).
to
be_an
(
Integer
)
expect
(
repository
.
tag_count
).
to
be_an
(
Integer
)
# NOTE: Until rugged goes away, make sure rugged and gitaly are in sync
# NOTE: Until rugged goes away, make sure rugged and gitaly are in sync
rugged_count
=
repository
.
raw_repository
.
rugged
.
tags
.
count
rugged_count
=
repository
.
raw_repository
.
rugged
.
tags
.
count
expect
(
repository
.
tag_count
).
to
eq
(
rugged_count
)
expect
(
repository
.
tag_count
).
to
eq
(
rugged_count
)
end
end
end
end
...
...
Write
Preview
Markdown
is supported
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