From df341dc9b874f7e7bf99d9c1de3a84c49c4a04a6 Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 25 Jun 2021 13:21:56 +0200 Subject: Cleaned up the backend --- packages/server/src/git/repository.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'packages/server/src/git/repository.ts') diff --git a/packages/server/src/git/repository.ts b/packages/server/src/git/repository.ts index ac0927a..ff23761 100644 --- a/packages/server/src/git/repository.ts +++ b/packages/server/src/git/repository.ts @@ -41,48 +41,48 @@ export class Repository { this.owner = data.owner; } - async commits(): Promise { + public async commits(): Promise { const walker = NodeGitRevwalk.create(this._ng_repository); walker.pushHead(); return Promise.all((await walker.getCommitsUntil(() => true)).map(commit => new Commit(this, commit))); } - async tree(): Promise { + public async tree(): Promise { const master_commit = await this._ng_repository.getMasterCommit(); const tree = await master_commit.getTree(); return new Tree(this, tree); } - lookupExists(id: string): Promise { + public lookupExists(id: string): Promise { return NodeGitObject.lookup(this._ng_repository, NodeGitOid.fromString(id), NodeGitObject.TYPE.ANY) .then(() => true) .catch(() => false); } - async branches(): Promise { + public async branches(): Promise { const references = await this._ng_repository.getReferences(); return references.filter(ref => ref.isBranch()).map(branch => new Branch(this, branch)); } - async tags(): Promise { + public async tags(): Promise { const references = await this._ng_repository.getReferences(); return references.filter(ref => ref.isTag()).map(tag => new Tag(this, tag)); } - async latestCommit(): Promise { + public async latestCommit(): Promise { return new Commit(this, await this._ng_repository.getMasterCommit()); } - HTTPconnect(req: Request, reply: FastifyReply): void { + public HTTPconnect(req: Request, reply: FastifyReply): void { connect(this, req, reply); } - get nodegitRepository(): NodeGitRepository { + public get nodegitRepository(): NodeGitRepository { return this._ng_repository; } - static async open(base_dir: string, repository: string): Promise { + public static async open(base_dir: string, repository: string): Promise { const ng_repository = await NodeGitRepository.openBare(`${base_dir}/${getFullRepositoryName(repository)}`); return new Repository(ng_repository, { @@ -91,7 +91,7 @@ export class Repository { }); } - static async openAll(base_dir: string): Promise { + public static async openAll(base_dir: string): Promise { const dir_content = await getDirectory(base_dir); if(dir_content.length === 0) { -- cgit v1.2.3-18-g5258