Commit a13c054c authored by Paul Slaughter's avatar Paul Slaughter

Merge branch 'revert-af7eff8f' into 'master'

Revert "Merge branch 'symlink-identifier/unique-id-all-diff-files' into 'master'"

See merge request gitlab-org/gitlab!34281
parents 8cfdade4 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);
......
......@@ -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,
......
......@@ -243,8 +243,6 @@ describe('DiffsStoreMutations', () => {
const data = {
diff_files: [
{
blob: {},
diff_refs: {},
content_sha: 'abc',
file_hash: fileHash,
extra_field: 1,
......
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];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment