Commit 6ef71484 authored by Phil Hughes's avatar Phil Hughes

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

This reverts merge request !34128
parent 1ff90a73
...@@ -16,7 +16,6 @@ import { ...@@ -16,7 +16,6 @@ import {
INLINE_DIFF_VIEW_TYPE, INLINE_DIFF_VIEW_TYPE,
PARALLEL_DIFF_VIEW_TYPE, PARALLEL_DIFF_VIEW_TYPE,
} from '../constants'; } from '../constants';
import { uuids } from '../utils/uuids';
export function findDiffFile(files, match, matchKey = 'file_hash') { export function findDiffFile(files, match, matchKey = 'file_hash') {
return files.find(file => file[matchKey] === match); return files.find(file => file[matchKey] === match);
...@@ -404,26 +403,8 @@ function deduplicateFilesList(files) { ...@@ -404,26 +403,8 @@ function deduplicateFilesList(files) {
return Object.values(dedupedFiles); 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 = []) { export function prepareDiffData(diff, priorFiles = []) {
const cleanedFiles = (diff.diff_files || []) const cleanedFiles = (diff.diff_files || [])
.map(prepareDiffFile)
.map(ensureBasicDiffFileLines) .map(ensureBasicDiffFileLines)
.map(prepareDiffFileLines) .map(prepareDiffFileLines)
.map(finalizeDiffFile); .map(finalizeDiffFile);
......
...@@ -13,7 +13,6 @@ export default { ...@@ -13,7 +13,6 @@ export default {
blob_name: 'CHANGELOG', blob_name: 'CHANGELOG',
blob_icon: '<i aria-hidden="true" data-hidden="true" class="fa fa-file-text-o fa-fw"></i>', blob_icon: '<i aria-hidden="true" data-hidden="true" class="fa fa-file-text-o fa-fw"></i>',
file_hash: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a', file_hash: '1c497fbb3a46b78edf04cc2a2fa33f67e3ffbe2a',
file_identifier_hash: '928f8286952bda02d674b692addcbe077084663a',
file_path: 'CHANGELOG', file_path: 'CHANGELOG',
new_file: false, new_file: false,
deleted_file: false, deleted_file: false,
......
...@@ -243,8 +243,6 @@ describe('DiffsStoreMutations', () => { ...@@ -243,8 +243,6 @@ describe('DiffsStoreMutations', () => {
const data = { const data = {
diff_files: [ diff_files: [
{ {
blob: {},
diff_refs: {},
content_sha: 'abc', content_sha: 'abc',
file_hash: fileHash, file_hash: fileHash,
extra_field: 1, extra_field: 1,
......
import { clone } from 'lodash'; import { clone } from 'lodash';
import * as utils from '~/diffs/store/utils'; import * as utils from '~/diffs/store/utils';
import { uuids } from '~/diffs/utils/uuids';
import { import {
LINE_POSITION_LEFT, LINE_POSITION_LEFT,
LINE_POSITION_RIGHT, LINE_POSITION_RIGHT,
...@@ -431,7 +430,6 @@ describe('DiffsStoreUtils', () => { ...@@ -431,7 +430,6 @@ describe('DiffsStoreUtils', () => {
}); });
describe('prepareDiffData', () => { describe('prepareDiffData', () => {
let fileId;
let mock; let mock;
let preparedDiff; let preparedDiff;
let splitInlineDiff; let splitInlineDiff;
...@@ -440,17 +438,6 @@ describe('DiffsStoreUtils', () => { ...@@ -440,17 +438,6 @@ describe('DiffsStoreUtils', () => {
beforeEach(() => { beforeEach(() => {
mock = getDiffFileMock(); 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] }; preparedDiff = { diff_files: [mock] };
splitInlineDiff = { splitInlineDiff = {
diff_files: [{ ...mock, parallel_diff_lines: undefined }], diff_files: [{ ...mock, parallel_diff_lines: undefined }],
...@@ -468,13 +455,6 @@ describe('DiffsStoreUtils', () => { ...@@ -468,13 +455,6 @@ describe('DiffsStoreUtils', () => {
completedDiff.diff_files = utils.prepareDiffData(completedDiff, [mock]); 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', () => { it('sets the renderIt and collapsed attribute on files', () => {
const firstParallelDiffLine = preparedDiff.diff_files[0].parallel_diff_lines[2]; 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