aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/git/commit.ts
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-06-25 13:21:56 +0200
committerHampusM <hampus@hampusmat.com>2021-06-25 13:21:56 +0200
commitdf341dc9b874f7e7bf99d9c1de3a84c49c4a04a6 (patch)
treefda4bcd92b9119bf4b95d393849d2f643eae8444 /packages/server/src/git/commit.ts
parenta13786d6cc185822f5940582efde2349ef729145 (diff)
Cleaned up the backend
Diffstat (limited to 'packages/server/src/git/commit.ts')
-rw-r--r--packages/server/src/git/commit.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/server/src/git/commit.ts b/packages/server/src/git/commit.ts
index 64bae4d..5d86eb4 100644
--- a/packages/server/src/git/commit.ts
+++ b/packages/server/src/git/commit.ts
@@ -38,11 +38,11 @@ export class Commit {
this.message = commit.message();
}
- async diff(): Promise<Diff> {
- return Diff.get((await this._ng_commit.getDiff())[0]);
+ public async diff(): Promise<Diff> {
+ return new Diff((await this._ng_commit.getDiff())[0]);
}
- async stats(): Promise<DiffStats> {
+ public async stats(): Promise<DiffStats> {
const stats = await (await this._ng_commit.getDiff())[0].getStats();
return {
@@ -52,16 +52,16 @@ export class Commit {
};
}
- async tree(): Promise<Tree> {
+ public async tree(): Promise<Tree> {
return new Tree(this._owner, await this._ng_commit.getTree());
}
- static async lookup(repository: Repository, id: string | NodeGitOid): Promise<Commit> {
+ public static async lookup(repository: Repository, id: string | NodeGitOid): Promise<Commit> {
const commit = await NodeGitCommit.lookup(repository.nodegitRepository, id instanceof NodeGitOid ? id : NodeGitOid.fromString(id));
return new Commit(repository, commit);
}
- static lookupExists(repository: Repository, id: string): Promise<boolean> {
+ public static lookupExists(repository: Repository, id: string): Promise<boolean> {
return NodeGitCommit.lookup(repository.nodegitRepository, NodeGitOid.fromString(id))
.then(() => true)
.catch(() => false);