From 2ca38d047c51ef0234349bf5cd9f4af2daeea95d Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Fri, 19 Jan 2024 17:41:32 +0100 Subject: [PATCH] fix(git): Try to fix a few glitches Signed-off-by: Marcel Klehr --- src/lib/adapters/Git.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/adapters/Git.ts b/src/lib/adapters/Git.ts index 971fed6d2d..02c406d947 100644 --- a/src/lib/adapters/Git.ts +++ b/src/lib/adapters/Git.ts @@ -277,7 +277,7 @@ export default class GitAdapter extends CachingAdapter { return false } - if (!fileContents.includes('') && !fileContents.includes('')) { + if (!fileContents || (fileContents.includes('') && !fileContents.includes(''))) { throw new FileUnreadableError() } @@ -313,6 +313,10 @@ export default class GitAdapter extends CachingAdapter { const hash = await Crypto.sha256(JSON.stringify(this.server)) + Date.now() this.dir = '/' + hash + '/' + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + const fs = new FS('floccus', {wipe: true}) + Logger.log('(git) init') await git.init({ fs, dir: this.dir, defaultBranch: this.server.branch }) await git.addRemote({