From 8c6a59cd766fead4998c957d86a0e33fd58d1cde Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 5 Aug 2021 17:03:36 +0200 Subject: The tree API has a branch query param & made repository branch less hardcoded --- packages/server/src/git/tree.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'packages/server/src/git/tree.ts') 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 { - 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 -- cgit v1.2.3-18-g5258