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
iv
gitlab-ce
Commits
5f0983b2
Commit
5f0983b2
authored
Sep 23, 2015
by
Stan Hu
Committed by
Robert Speicher
Sep 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove git refs used internally by GitLab from network graph
Closes #2702
parent
6dd5b1cc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
CHANGELOG
CHANGELOG
+1
-0
app/helpers/graph_helper.rb
app/helpers/graph_helper.rb
+4
-1
spec/helpers/graph_helper_spec.rb
spec/helpers/graph_helper_spec.rb
+16
-0
No files found.
CHANGELOG
View file @
5f0983b2
...
...
@@ -7,6 +7,7 @@ v 8.0.2 (unreleased)
- Make commit graphs responsive to window width changes (Stan Hu)
- Fix top margin for sign-in button on public pages
- Fix LDAP attribute mapping
- Remove git refs used internally by GitLab from network graph (Stan Hu)
v 8.0.1
- Improve CI migration procedure and documentation
...
...
app/helpers/graph_helper.rb
View file @
5f0983b2
module
GraphHelper
def
get_refs
(
repo
,
commit
)
refs
=
""
refs
<<
commit
.
ref_names
(
repo
).
join
(
' '
)
# Commit::ref_names already strips the refs/XXX from important refs (e.g. refs/heads/XXX)
# so anything leftover is internally used by GitLab
commit_refs
=
commit
.
ref_names
(
repo
).
reject
{
|
name
|
name
.
starts_with?
(
'refs/'
)
}
refs
<<
commit_refs
.
join
(
' '
)
# append note count
refs
<<
"[
#{
@graph
.
notes
[
commit
.
id
]
}
]"
if
@graph
.
notes
[
commit
.
id
]
>
0
...
...
spec/helpers/graph_helper_spec.rb
0 → 100644
View file @
5f0983b2
require
'spec_helper'
describe
GraphHelper
do
describe
'#get_refs'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:commit
)
{
project
.
commit
(
"master"
)
}
let
(
:graph
)
{
Network
::
Graph
.
new
(
project
,
'master'
,
commit
,
''
)
}
it
'filter our refs used by GitLab'
do
allow
(
commit
).
to
receive
(
:ref_names
).
and_return
([
'refs/merge-requests/abc'
,
'master'
,
'refs/tmp/xyz'
])
self
.
instance_variable_set
(
:@graph
,
graph
)
refs
=
get_refs
(
project
.
repository
,
commit
)
expect
(
refs
).
to
eq
(
'master'
)
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