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({