diff options
author | HampusM <hampus@hampusmat.com> | 2021-08-18 17:29:55 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-08-18 17:29:55 +0200 |
commit | d1a1b7dc947063aef5f8375a6a1e03246b272c84 (patch) | |
tree | f5cb9bd6d4b5463d9d022026ac6fea87cb6ebe02 /packages/server/src/git/tree_entry.ts | |
parent | 6ed078de30a7bf35deace728857d1d293d59eb15 (diff) |
Implemented caching for certain API endpoints, Added documentation & made backend-fixes
Diffstat (limited to 'packages/server/src/git/tree_entry.ts')
-rw-r--r-- | packages/server/src/git/tree_entry.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/server/src/git/tree_entry.ts b/packages/server/src/git/tree_entry.ts index b03ea9e..cdcb0d3 100644 --- a/packages/server/src/git/tree_entry.ts +++ b/packages/server/src/git/tree_entry.ts @@ -31,11 +31,11 @@ export abstract class BaseTreeEntry { */ public async latestCommit(): Promise<Commit> { const rev_walk = NodeGitRevwalk.create(this._owner.ng_repository); - rev_walk.pushRef(`refs/heads/${this._owner.branch_name}`); + rev_walk.pushRef(`refs/heads/${this._owner.branch}`); const commit_cnt = (await rev_walk.getCommitsUntil(() => true)).length; - rev_walk.pushRef(`refs/heads/${this._owner.branch_name}`); + rev_walk.pushRef(`refs/heads/${this._owner.branch}`); const file_hist = await rev_walk.fileHistoryWalk(this.path, commit_cnt); return new Commit(this._owner, file_hist[0].commit); @@ -48,11 +48,11 @@ export abstract class BaseTreeEntry { */ public async history(count?: number): Promise<Commit[]> { const rev_walk = NodeGitRevwalk.create(this._owner.ng_repository); - rev_walk.pushRef(`refs/heads/${this._owner.branch_name}`); + rev_walk.pushRef(`refs/heads/${this._owner.branch}`); const commit_cnt = (await rev_walk.getCommitsUntil(() => true)).length; - rev_walk.pushRef(`refs/heads/${this._owner.branch_name}`); + rev_walk.pushRef(`refs/heads/${this._owner.branch}`); const file_hist = await rev_walk.fileHistoryWalk(this.path, commit_cnt); 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)))); |