diff options
author | HampusM <hampus@hampusmat.com> | 2021-08-05 17:03:36 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-08-05 17:03:36 +0200 |
commit | 8c6a59cd766fead4998c957d86a0e33fd58d1cde (patch) | |
tree | ff2cd43a4a5dafb27348fc320784c39f1fe9c941 /packages/server/src/git/tree.ts | |
parent | 22bf491be5f25bccf779be53b2ad37836f0850b8 (diff) |
The tree API has a branch query param & made repository branch less hardcoded
Diffstat (limited to 'packages/server/src/git/tree.ts')
-rw-r--r-- | packages/server/src/git/tree.ts | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/packages/server/src/git/tree.ts b/packages/server/src/git/tree.ts index 2d3888e..7936e5d 100644 --- a/packages/server/src/git/tree.ts +++ b/packages/server/src/git/tree.ts @@ -3,6 +3,7 @@ import { Repository } from "./repository"; import { BaseTreeEntry, BlobTreeEntry, createTreeEntry, TreeEntry } from "./tree_entry"; import { createError, TreeError } from "./error"; import { pack, Pack } from "tar-stream"; +import { Commit } from "./commit"; /** * A representation of a git tree @@ -91,16 +92,11 @@ export class Tree { /** * Returns the tree of a repository * - * @remarks - * - * Assumes that you want to use the master branch. - * This will be fixed in the future. - * * @param owner The repository which the tree is in * @returns An instance of a tree */ public static async ofRepository(owner: Repository): Promise<Tree> { - const master_commit = await owner.masterCommit(); - return master_commit.tree(); + const commit = await Commit.branchCommit(owner); + return commit.tree(); } }
\ No newline at end of file |