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
6ef71484
Commit
6ef71484
authored
Jun 10, 2020
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'symlink-identifier/unique-id-all-diff-files' into 'master'"
This reverts merge request !34128
parent
1ff90a73
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
42 deletions
+0
-42
app/assets/javascripts/diffs/store/utils.js
app/assets/javascripts/diffs/store/utils.js
+0
-19
spec/frontend/diffs/mock_data/diff_file.js
spec/frontend/diffs/mock_data/diff_file.js
+0
-1
spec/frontend/diffs/store/mutations_spec.js
spec/frontend/diffs/store/mutations_spec.js
+0
-2
spec/frontend/diffs/store/utils_spec.js
spec/frontend/diffs/store/utils_spec.js
+0
-20
No files found.
app/assets/javascripts/diffs/store/utils.js
View file @
6ef71484
...
...
@@ -16,7 +16,6 @@ import {
INLINE_DIFF_VIEW_TYPE
,
PARALLEL_DIFF_VIEW_TYPE
,
}
from
'
../constants
'
;
import
{
uuids
}
from
'
../utils/uuids
'
;
export
function
findDiffFile
(
files
,
match
,
matchKey
=
'
file_hash
'
)
{
return
files
.
find
(
file
=>
file
[
matchKey
]
===
match
);
...
...
@@ -404,26 +403,8 @@ function deduplicateFilesList(files) {
return
Object
.
values
(
dedupedFiles
);
}
function
prepareDiffFile
(
file
)
{
Object
.
assign
(
file
,
{
uuid
:
uuids
({
seeds
:
[
file
.
blob
.
id
,
file
.
diff_refs
.
base_sha
,
file
.
diff_refs
.
start_sha
,
file
.
diff_refs
.
head_sha
,
file
.
file_identifier_hash
,
Number
(
file
.
blob
.
mode
),
],
})[
0
],
});
return
file
;
}
export
function
prepareDiffData
(
diff
,
priorFiles
=
[])
{
const
cleanedFiles
=
(
diff
.
diff_files
||
[])
.
map
(
prepareDiffFile
)
.
map
(
ensureBasicDiffFileLines
)
.
map
(
prepareDiffFileLines
)
.
map
(
finalizeDiffFile
);
...
...
spec/frontend/diffs/mock_data/diff_file.js
View file @
6ef71484
...
...
@@ -13,7 +13,6 @@ export default {
blob_name
:
'
CHANGELOG
'
,
blob_icon
:
'
<i aria-hidden="true" data-hidden="true" class="fa fa-file-text-o fa-fw"></i>
'
,
file_hash
:
'
1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a
'
,
file_identifier_hash
:
'
928f8286952bda02d674b692addcbe077084663a
'
,
file_path
:
'
CHANGELOG
'
,
new_file
:
false
,
deleted_file
:
false
,
...
...
spec/frontend/diffs/store/mutations_spec.js
View file @
6ef71484
...
...
@@ -243,8 +243,6 @@ describe('DiffsStoreMutations', () => {
const
data
=
{
diff_files
:
[
{
blob
:
{},
diff_refs
:
{},
content_sha
:
'
abc
'
,
file_hash
:
fileHash
,
extra_field
:
1
,
...
...
spec/frontend/diffs/store/utils_spec.js
View file @
6ef71484
import
{
clone
}
from
'
lodash
'
;
import
*
as
utils
from
'
~/diffs/store/utils
'
;
import
{
uuids
}
from
'
~/diffs/utils/uuids
'
;
import
{
LINE_POSITION_LEFT
,
LINE_POSITION_RIGHT
,
...
...
@@ -431,7 +430,6 @@ describe('DiffsStoreUtils', () => {
});
describe
(
'
prepareDiffData
'
,
()
=>
{
let
fileId
;
let
mock
;
let
preparedDiff
;
let
splitInlineDiff
;
...
...
@@ -440,17 +438,6 @@ describe('DiffsStoreUtils', () => {
beforeEach
(()
=>
{
mock
=
getDiffFileMock
();
[
fileId
]
=
uuids
({
seeds
:
[
mock
.
blob
.
id
,
mock
.
diff_refs
.
base_sha
,
mock
.
diff_refs
.
start_sha
,
mock
.
diff_refs
.
head_sha
,
mock
.
file_identifier_hash
,
Number
(
mock
.
blob
.
mode
),
],
});
preparedDiff
=
{
diff_files
:
[
mock
]
};
splitInlineDiff
=
{
diff_files
:
[{
...
mock
,
parallel_diff_lines
:
undefined
}],
...
...
@@ -468,13 +455,6 @@ describe('DiffsStoreUtils', () => {
completedDiff
.
diff_files
=
utils
.
prepareDiffData
(
completedDiff
,
[
mock
]);
});
it
(
'
adds a universally unique identifier to each diff file
'
,
()
=>
{
expect
(
preparedDiff
.
diff_files
[
0
].
uuid
).
toBe
(
fileId
);
expect
(
splitInlineDiff
.
diff_files
[
0
].
uuid
).
toBe
(
fileId
);
expect
(
splitParallelDiff
.
diff_files
[
0
].
uuid
).
toBe
(
fileId
);
expect
(
completedDiff
.
diff_files
[
0
].
uuid
).
toBe
(
fileId
);
});
it
(
'
sets the renderIt and collapsed attribute on files
'
,
()
=>
{
const
firstParallelDiffLine
=
preparedDiff
.
diff_files
[
0
].
parallel_diff_lines
[
2
];
...
...
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