diff --git a/addons/isl/src/getCommitTree.ts b/addons/isl/src/getCommitTree.ts index 37321e2c0a5fb..6352b78c7d6c3 100644 --- a/addons/isl/src/getCommitTree.ts +++ b/addons/isl/src/getCommitTree.ts @@ -6,7 +6,7 @@ */ import type {CommitPreview, Dag, WithPreviewType} from './previews'; -import type {CommitInfo, Hash} from './types'; +import type {CommitInfo} from './types'; export type CommitTree = { info: CommitInfo; @@ -130,11 +130,3 @@ export function findCurrentPublicBase(dag?: Dag): CommitInfo | undefined { } return undefined; } - -export function makeTreeMap(trees: Array): Map { - const map = new Map(); - for (const tree of walkTreePostorder(trees)) { - map.set(tree.info.hash, tree); - } - return map; -} diff --git a/addons/isl/src/serverAPIState.ts b/addons/isl/src/serverAPIState.ts index f8b82bf170ff1..eebab600ac01f 100644 --- a/addons/isl/src/serverAPIState.ts +++ b/addons/isl/src/serverAPIState.ts @@ -6,7 +6,6 @@ */ import type {MessageBusStatus} from './MessageBus'; -import type {CommitTree} from './getCommitTree'; import type {Operation} from './operations/Operation'; import type { ApplicationInfo, @@ -28,7 +27,6 @@ import serverAPI from './ClientToServerAPI'; import messageBus from './MessageBus'; import {latestSuccessorsMap, successionTracker} from './SuccessionTracker'; import {Dag} from './dag/dag'; -import {makeTreeMap, getCommitTree} from './getCommitTree'; import {persistAtomToConfigEffect} from './persistAtomToConfigEffect'; import {clearOnCwdChange} from './recoilUtils'; import {initialParams} from './urlParams'; @@ -385,20 +383,6 @@ export const commitsShownRange = atom({ ], }); -/** - * Latest fetched commit tree from the server, without any previews. - * Prefer using `treeWithPreviews.trees`, since it includes optimistic state - * and previews. - */ -export const latestCommitTree = selector>({ - key: 'latestCommitTree', - get: ({get}) => { - const commits = get(latestCommits); - const tree = getCommitTree(commits); - return tree; - }, -}); - /** * Latest head commit from original data from the server, without any previews. * Prefer using `treeWithPreviews.headCommit`, since it includes optimistic state @@ -412,21 +396,6 @@ export const latestHeadCommit = selector({ }, }); -/** - * Mapping of commit hash -> subtree at that commit - * Latest mapping of commit hash -> subtree at that commit from original data - * from the server, without any previews. - * Prefer using `treeWithPreviews.treeMap`, since it includes - * optimistic state and previews. - */ -export const latestCommitTreeMap = selector>({ - key: 'latestCommitTreeMap', - get: ({get}) => { - const trees = get(latestCommitTree); - return makeTreeMap(trees); - }, -}); - /** * No longer in the "loading" state: * - Either the list of commits has successfully loaded