···11import { error, redirect } from "@sveltejs/kit";
22import { createBobbinClient } from "$lib/api/client";
33import { count } from "$lib/api/count";
44+import { gitTarget, resolveDefaultBranch } from "$lib/api/gitclient";
45import { getStarRkey } from "$lib/api/graph";
56import { IdentityCache, resolveMiniDoc } from "$lib/api/identity";
66-import { getDefaultBranch } from "$lib/api/knot";
77import { parallel, toHttpError } from "$lib/api/load";
88import { getRepo } from "$lib/api/records";
99import { repoNameOf, resolveRepoByName } from "$lib/api/repo";
···6161 const record = view.value;
6262 const repoDid = record.repoDid;
6363 const viewerDid = parent.auth?.did;
6464+ const git = gitTarget(parent.publicConfig, { uri: view.uri, repoDid }, event.fetch);
64656566 const stats = await parallel({
6666- // only the knot knows the default branch. a knot that is down or still
6767- // syncing shouldn't take out the whole layout
6868- defaultBranch: getDefaultBranch(ctx, { repo: view.uri })
6969- .then((branch) => branch.name)
7070- .catch(() => null),
6767+ // only the git backend knows the default branch, and one that is down
6868+ // or still syncing shouldn't take out the whole layout
6969+ defaultBranch: resolveDefaultBranch(git),
7170 stars: repoDid
7271 ? count(ctx, "sh.tangled.feed.countStars", repoDid).catch(() => null)
7372 : Promise.resolve(null),