diff options
author | HampusM <hampus@hampusmat.com> | 2021-07-27 13:18:42 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-07-27 13:18:42 +0200 |
commit | f6a5fe05c887a658c20257d2ef6bf2780f792873 (patch) | |
tree | 9ee4b42ed04b3fe7decdac10b20ec96ca764d378 /packages/server/src/git/blob.ts | |
parent | 69c58c94bd8cc0d469ae301931d4571aca84851a (diff) |
Refactored the backend a bit & added TSDoc/JSDoc comments to the diff class
Diffstat (limited to 'packages/server/src/git/blob.ts')
-rw-r--r-- | packages/server/src/git/blob.ts | 9 |
1 files changed, 4 insertions, 5 deletions
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<string> { - 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 |