{"draft":null,"from":116,"to":318,"files":[{"path":"client/src/at.ts","added":8,"removed":7,"diff":"--- a/client/src/at.ts\n+++ b/client/src/at.ts\n@@ -25,19 +25,20 @@\n \treadonly modes: Map<string, FullMode>;\n }\n \n-/** Each file as it is on one side of a change (`before`), applied to the snapshot. */\n-function applyBefore(s: Snapshot, changes: readonly FileChange[]): void {\n+/** Each file as it is on one side of a change (`before` unless said), applied to the snapshot. */\n+export function applySide(s: Snapshot, changes: readonly FileChange[], side: \"before\" | \"after\" = \"before\"): void {\n \tfor (const f of changes) {\n \t\tif (isLocalOnly(f.path)) continue;\n-\t\tconst blob = f.blob?.before ?? null;\n+\t\tconst blob = f.blob?.[side] ?? null;\n+\t\tconst text = f[side];\n \t\tif (blob !== null) s.files.set(f.path, { blob });\n-\t\telse if (f.before !== null) s.files.set(f.path, { text: f.before });\n+\t\telse if (text !== null) s.files.set(f.path, { text });\n \t\telse {\n \t\t\ts.files.delete(f.path);\n \t\t\ts.modes.delete(f.path);\n \t\t\tcontinue;\n \t\t}\n-\t\tif (f.mode) s.modes.set(f.path, { exec: f.mode.before.exec === true, link: f.mode.before.link ?? null });\n+\t\tif (f.mode) s.modes.set(f.path, { exec: f.mode[side].exec === true, link: f.mode[side].link ?? null });\n \t}\n }\n \n@@ -56,9 +57,9 @@\n \tfor (const [rel, sha] of readKnownBlobs(root)) s.files.set(rel, { blob: sha });\n \tfor (const [rel, mode] of readKnownModes(root)) if (s.files.has(rel)) s.modes.set(rel, mode);\n \t// Its base: the draft's changes taken back out.\n-\tapplyBefore(s, diff.files);\n+\tapplySide(s, diff.files);\n \t// Version N: what differs from the base, as it was at N.\n-\tif (version !== diff.base) applyBefore(s, (await api.compare(version, diff.base, where)).files);\n+\tif (version !== diff.base) applySide(s, (await api.compare(version, diff.base, where)).files);\n \treturn s;\n }\n "}],"unmatched":[]}