Fix deletion for the test-repo
backend.
Deletion was added in #485, but the function for the `test-repo` backend was `deleteEntry` instead of `deleteFile` like it was supposed to be. Also, setting the key for a deleted file to `undefined` did not really remove that file from the object, so there were then errors stating `file.content` is not defined. `delete`ing the "file" from the object fixes this bug.
This commit is contained in:
parent
c3b3e5d12f
commit
37f6e7bac5
@ -93,10 +93,10 @@ export default class TestRepo {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
deleteEntry(path, commitMessage) {
|
||||
deleteFile(path, commitMessage) {
|
||||
const folder = path.substring(0, path.lastIndexOf('/'));
|
||||
const fileName = path.substring(path.lastIndexOf('/') + 1);
|
||||
window.repoFiles[folder][fileName] = undefined;
|
||||
delete window.repoFiles[folder][fileName];
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user