From 64598e63c64bac18bd7fd3c1f935843c9e3e8d5a Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Thu, 13 Apr 2023 17:36:16 -0400 Subject: [PATCH] fix(backend): create renamed parent directory --- server/backend/sqlite/sqlite.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/backend/sqlite/sqlite.go b/server/backend/sqlite/sqlite.go index 0b64c2aa8..0d1f1c015 100644 --- a/server/backend/sqlite/sqlite.go +++ b/server/backend/sqlite/sqlite.go @@ -254,6 +254,11 @@ func (d *SqliteBackend) RenameRepository(oldName string, newName string) error { return wrapDbErr(err) } + // Make sure the new repository parent directory exists. + if err := os.MkdirAll(filepath.Dir(np), 0755); err != nil { + return err + } + return os.Rename(op, np) }