Add files to empty repository (#1717)

It should also be possible to create new files in empty non-initiated repositories with the help of scm-manager/scm-editor-plugin/pull/39. So that the plugin can mount itself, a new endpoint was provided hereby.

Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
This commit is contained in:
Florian Scholdei
2021-07-13 11:40:49 +02:00
committed by GitHub
parent 1ce19eea4a
commit 0d0f9995fe
7 changed files with 168 additions and 105 deletions

View File

@@ -28,14 +28,14 @@ export const isRootPath = (path: string) => {
};
export const isRootFile = (file: File) => {
if (!file.directory) {
if (!file?.directory) {
return false;
}
return isRootPath(file.path);
};
export const isEmptyDirectory = (file: File) => {
if (!file.directory) {
if (!file?.directory) {
return false;
}
return (file._embedded?.children?.length || 0) === 0;