web/repo: a pull page asks for no diff of a round without commits, and finds its target branch in the sidebar
Signed-off-by: dawn <90008@klbr.net>
145 unmodified linesExpand all14614714814915015015115215358 unmodified lines21221321421521621721821821922022122222322422522622734 unmodified lines262263264265266267262268269270271272273274544 unmodified linesExpand all145 unmodified linesExpand all fetch: globalThis.fetch }); return getRef(bobbin, { repo, ref: `refs/heads/${pull.targetBranch}` }); }; const targetRef = $derived(fetchTargetRef());
const statOf = (shown?: RepoDiff) => shown && { insertions: shown.stat.insertions,58 unmodified lines if (!hasGit(repo)) return []; return repoBranches(gitTarget(data.publicConfig, repo, globalThis.fetch)); });
// the sidebar names every branch of a repo with up to REF_LIMIT refs, past that the knot is asked const targetBranchLives = createLoad(async () => { if (!browser || !targetRef) return false; if (!browser) return false; const sidebar = await Promise.resolve(data.sidebar).catch(() => null); if (sidebar && !sidebar.failed.refs && sidebar.branches.length === sidebar.totalBranches) return sidebar.branches.some((branch) => branch.name === pull.targetBranch); const targetRef = fetchTargetRef(); if (!targetRef) return false; try { await targetRef; return true; } catch {34 unmodified lines globalThis.fetch ) });
// a round the knot has no commits for has no diff to ask for const diff = createLoad(async () => data.commitsFailed ? undefined : (data.diff ?? loadDiff(diffDeps, diffSpec)) data.commitsFailed || !view.base || !view.head ? undefined : (data.diff ?? loadDiff(diffDeps, diffSpec)) ); const loadedDiff = $derived(data.diff ?? diff.data ?? undefined);
// a reload keeps the last diff on screen until the next one lands544 unmodified linesExpand all