aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/git/tree_entry.ts
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-08-08 15:33:22 +0200
committerHampusM <hampus@hampusmat.com>2021-08-08 15:33:22 +0200
commitf2d55a9f05f5df7960d7f6dd37d1ef96c762d65a (patch)
tree737a61da8603520f9afec553791a222f88bc4ff3 /packages/server/src/git/tree_entry.ts
parent17c20d77600407209908de5541415f2c4a85f5e3 (diff)
Added a tree commit history API endpoint
Diffstat (limited to 'packages/server/src/git/tree_entry.ts')
-rw-r--r--packages/server/src/git/tree_entry.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/server/src/git/tree_entry.ts b/packages/server/src/git/tree_entry.ts
index 182543e..a217e29 100644
--- a/packages/server/src/git/tree_entry.ts
+++ b/packages/server/src/git/tree_entry.ts
@@ -1,5 +1,5 @@
import { Commit } from "./commit";
-import { Revwalk as NodeGitRevwalk, TreeEntry as NodeGitTreeEntry } from "nodegit";
+import { Revwalk as NodeGitRevwalk, TreeEntry as NodeGitTreeEntry, Commit as NodeGitCommit } from "nodegit";
import { Repository } from "./repository";
import { Tree } from "./tree";
import { Blob } from "./blob";
@@ -55,7 +55,7 @@ export abstract class BaseTreeEntry {
rev_walk.pushRef(`refs/heads/${this._owner.branch_name}`);
const file_hist = await rev_walk.fileHistoryWalk(this.path, commit_cnt);
- const commit_history = file_hist.map(hist_entry => new Commit(this._owner, hist_entry.commit));
+ const commit_history = await Promise.all(file_hist.map(async hist_entry => new Commit(this._owner, await NodeGitCommit.lookup(this._owner.ng_repository, hist_entry.commit))));
return count
? commit_history.slice(0, count)