Lines 179–194 at 181 (were 179–199 at 180)
179179 // Each file goes into the tree as a blob with its mode (#27): 100755 for exec, 120000 for a link, whose blob is 181181 const enc = new TextEncoder(); 182− for (const path of Object.keys(shared.files)) {
183− const mode = shared.modes?.[path];
184− const link = typeof mode?.link === "string" ? mode.link : null;
185− const bytes = enc.encode(link ?? shared.files[path]!);
186− await put(path, bytes, link !== null ? "120000" : mode?.exec ? "100755" : "100644", await blobOid(bytes));
187− }
188182 const agent = shared.last?.agent ?? "abso"; 189183 const author = { name: agent, email: `${agent}@abso.invalid` }; 190184 const committer = { name: "abso", email: "abso@abso.invalid" }; 191185 const say = (p: string) => `${shared.last?.message ?? "Start the project"}${p}\n\nabso-version: ${shared.version}\n`; 192186 let parent = head; 193− // A part holds what's written so far, and the last push's entries for the binary files not reached yet.
187+ // A part holds what's written so far and preserves old entries for files not reached yet. 194188 const commitNow = async (message: string) => { 195189 const files = new Map(now); 196− for (const [path, f] of old.files) if (!files.has(path) && path in blobs) files.set(path, f);
190+ for (const [path, f] of old.files) 191+ if (!files.has(path) && (path in blobs || path in shared.files)) files.set(path, f); 197192 const tree = await writeTrees(fs, dir, files, old.trees, changed); 198193 parent = await git.commit({ Lines 203–226 at 181 (were 208–219 at 180)
211− // Binary files (#27) aren't in files: their bytes come from the blob store.
212− // Artifacts refuses a push much over 20 MB, so when the new blobs add up
206+ // Artifacts refuses a push much over 20 MB, so when new text or binary blobs add up 213207 // to more than PUSH_BATCH, the earlier ones go in commits of their own 214208 // first. Every part carries abso-version, so intake never takes them in. 211+ for (const path of Object.keys(shared.files)) { 212+ const mode = shared.modes?.[path]; 213+ const link = typeof mode?.link === "string" ? mode.link : null; 214+ const bytes = enc.encode(link ?? shared.files[path]!); 215+ const oid = await blobOid(bytes); 216+ const fresh = old.files.get(path)?.oid !== oid; 217+ if (fresh && pending > 0 && pending + bytes.byteLength > PUSH_BATCH) { 218+ await part(await commitNow(say(` (part ${++parts})`))); 221+ if (fresh) pending += bytes.byteLength; 222+ await put(path, bytes, link !== null ? "120000" : mode?.exec ? "100755" : "100644", oid); 217224 for (const [path, sha] of Object.entries(blobs)) { 218225 const bytes = readBlob(sha); 219226 if (!bytes) throw new Error(`${path}: blob ${sha} is missing from the project's store`);