Skip to content
Snippets Groups Projects
Commit 48823037 authored by Denys Mishunov's avatar Denys Mishunov
Browse files

Fixed deletion of directories in Web IDE

parent 7a22b4ba
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -129,7 +129,7 @@ export const commitActionForFile = file => {
 
export const getCommitFiles = stagedFiles =>
stagedFiles.reduce((acc, file) => {
if (file.moved) return acc;
if (file.moved || file.type === 'tree') return acc;
 
return acc.concat({
...file,
Loading
Loading
---
title: Fixed removing directories in Web IDE
merge_request: 31727
author:
type: fixed
Loading
Loading
@@ -261,6 +261,41 @@ describe('Multi-file store utils', () => {
},
]);
});
it('filters out folders from the list', () => {
const files = [
{
path: 'a',
type: 'blob',
deleted: true,
},
{
path: 'c',
type: 'tree',
deleted: true,
},
{
path: 'c/d',
type: 'blob',
deleted: true,
},
];
const flattendFiles = utils.getCommitFiles(files);
expect(flattendFiles).toEqual([
{
path: 'a',
type: 'blob',
deleted: true,
},
{
path: 'c/d',
type: 'blob',
deleted: true,
},
]);
});
});
 
describe('mergeTrees', () => {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment