From f6a5fe05c887a658c20257d2ef6bf2780f792873 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 27 Jul 2021 13:18:42 +0200 Subject: Refactored the backend a bit & added TSDoc/JSDoc comments to the diff class --- packages/server/src/git/blob.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'packages/server/src/git/blob.ts') diff --git a/packages/server/src/git/blob.ts b/packages/server/src/git/blob.ts index eebd2d4..4dadc01 100644 --- a/packages/server/src/git/blob.ts +++ b/packages/server/src/git/blob.ts @@ -12,19 +12,18 @@ export class Blob { /** * @param entry - A tree entry that's a blob - * @param path - A path */ - constructor(entry: BlobTreeEntry, path: string) { + constructor(entry: BlobTreeEntry) { this._tree_entry = entry; - this.path = path; + this.path = entry.path; } /** * Returns the blob's content */ public async content(): Promise { - return this._tree_entry.content(); + return (await this._tree_entry.ng_tree_entry.getBlob()).content.toString(); } /** @@ -41,6 +40,6 @@ export class Blob { throw(createError(BlobError, 500, "Not a blob")); } - return new Blob(entry, path); + return new Blob(entry); } } \ No newline at end of file -- cgit v1.2.3-18-g5258