aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/git/blob.ts
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-07-27 13:18:42 +0200
committerHampusM <hampus@hampusmat.com>2021-07-27 13:18:42 +0200
commitf6a5fe05c887a658c20257d2ef6bf2780f792873 (patch)
tree9ee4b42ed04b3fe7decdac10b20ec96ca764d378 /packages/server/src/git/blob.ts
parent69c58c94bd8cc0d469ae301931d4571aca84851a (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.ts9
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