Commit 48823037 authored by Denys Mishunov's avatar Denys Mishunov

Fixed deletion of directories in Web IDE

parent 7a22b4ba
......@@ -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,
......
---
title: Fixed removing directories in Web IDE
merge_request: 31727
author:
type: fixed
......@@ -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', () => {
......
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