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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
8b1a8fcc
Commit
8b1a8fcc
authored
Sep 02, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
d5f3460f
62b00145
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
app/assets/javascripts/branches/divergence_graph.js
app/assets/javascripts/branches/divergence_graph.js
+5
-0
changelogs/unreleased/sh-suppress-diverging-count-commits-request.yml
...nreleased/sh-suppress-diverging-count-commits-request.yml
+5
-0
spec/frontend/branches/divergence_graph_spec.js
spec/frontend/branches/divergence_graph_spec.js
+13
-1
No files found.
app/assets/javascripts/branches/divergence_graph.js
View file @
8b1a8fcc
...
...
@@ -25,6 +25,11 @@ export default endpoint => {
const
names
=
[...
document
.
querySelectorAll
(
'
.js-branch-item
'
)].
map
(
({
dataset
})
=>
dataset
.
name
,
);
if
(
names
.
length
===
0
)
{
return
true
;
}
return
axios
.
get
(
endpoint
,
{
params
:
{
names
},
...
...
changelogs/unreleased/sh-suppress-diverging-count-commits-request.yml
0 → 100644
View file @
8b1a8fcc
---
title
:
Skip requesting diverging commit counts if no branches are listed
merge_request
:
32496
author
:
type
:
performance
spec/frontend/branches/divergence_graph_spec.js
View file @
8b1a8fcc
...
...
@@ -25,13 +25,25 @@ describe('Divergence graph', () => {
mock
.
restore
();
});
it
(
'
calls axos get with list of branch names
'
,
()
=>
it
(
'
calls ax
i
os get with list of branch names
'
,
()
=>
init
(
'
/-/diverging_counts
'
).
then
(()
=>
{
expect
(
axios
.
get
).
toHaveBeenCalledWith
(
'
/-/diverging_counts
'
,
{
params
:
{
names
:
[
'
master
'
,
'
test/hello-world
'
]
},
});
}));
describe
(
'
no branches listed
'
,
()
=>
{
beforeEach
(()
=>
{
document
.
body
.
innerHTML
=
`<div></div>`
;
});
it
(
'
avoids requesting diverging commit counts
'
,
()
=>
{
expect
(
axios
.
get
).
not
.
toHaveBeenCalledWith
(
'
/-/diverging_counts
'
);
init
(
'
/-/diverging_counts
'
);
});
});
it
(
'
creates Vue components
'
,
()
=>
init
(
'
/-/diverging_counts
'
).
then
(()
=>
{
expect
(
document
.
querySelector
(
'
[data-name="master"]
'
).
innerHTML
).
not
.
toEqual
(
''
);
...
...
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