fixed review mode diffs
This commit is contained in:
parent
6ce90bfb9f
commit
bc827dfd3a
4 changed files with 15 additions and 44 deletions
|
@ -225,6 +225,7 @@ export default {
|
|||
url: oldEntry.url.replace(new RegExp(`${oldEntry.path}/?$`), newPath),
|
||||
tree: [],
|
||||
parentPath,
|
||||
raw: '',
|
||||
};
|
||||
oldEntry.moved = true;
|
||||
oldEntry.movedPath = newPath;
|
||||
|
|
|
@ -56,9 +56,15 @@ export default {
|
|||
f => f.path === file.path && f.pending && !(f.tempFile && !f.prevPath),
|
||||
);
|
||||
|
||||
if (file.tempFile) {
|
||||
Object.assign(state.entries[file.path], {
|
||||
content: raw,
|
||||
});
|
||||
} else {
|
||||
Object.assign(state.entries[file.path], {
|
||||
raw,
|
||||
});
|
||||
}
|
||||
|
||||
if (!openPendingFile) return;
|
||||
|
||||
|
|
|
@ -294,7 +294,7 @@ describe('IDE commit module actions', () => {
|
|||
{
|
||||
action: 'update',
|
||||
file_path: jasmine.anything(),
|
||||
content: jasmine.anything(),
|
||||
content: undefined,
|
||||
encoding: jasmine.anything(),
|
||||
last_commit_id: undefined,
|
||||
previous_path: undefined,
|
||||
|
|
|
@ -125,7 +125,7 @@ describe('Multi-file store utils', () => {
|
|||
{
|
||||
action: 'delete',
|
||||
file_path: 'deletedFile',
|
||||
content: '',
|
||||
content: undefined,
|
||||
encoding: 'text',
|
||||
last_commit_id: undefined,
|
||||
previous_path: undefined,
|
||||
|
@ -210,38 +210,17 @@ describe('Multi-file store utils', () => {
|
|||
});
|
||||
|
||||
describe('getCommitFiles', () => {
|
||||
it('returns flattened list of files and folders', () => {
|
||||
it('returns list of files excluding moved files', () => {
|
||||
const files = [
|
||||
{
|
||||
path: 'a',
|
||||
type: 'blob',
|
||||
deleted: true,
|
||||
},
|
||||
{
|
||||
path: 'b',
|
||||
type: 'tree',
|
||||
deleted: true,
|
||||
tree: [
|
||||
{
|
||||
path: 'c',
|
||||
type: 'blob',
|
||||
},
|
||||
{
|
||||
path: 'd',
|
||||
type: 'blob',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'c',
|
||||
prevPath: 'x',
|
||||
type: 'tree',
|
||||
tree: [
|
||||
{
|
||||
path: 'c/index.js',
|
||||
type: 'blob',
|
||||
},
|
||||
],
|
||||
moved: true,
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -253,21 +232,6 @@ describe('Multi-file store utils', () => {
|
|||
type: 'blob',
|
||||
deleted: true,
|
||||
},
|
||||
{
|
||||
path: 'c',
|
||||
type: 'blob',
|
||||
deleted: true,
|
||||
},
|
||||
{
|
||||
path: 'd',
|
||||
type: 'blob',
|
||||
deleted: true,
|
||||
},
|
||||
{
|
||||
path: 'c/index.js',
|
||||
type: 'blob',
|
||||
deleted: true,
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue