@@ -38203,7 +38203,7 @@ async function getCachedObjectSha(path) {
3820338203async function createCommit(octokit, repository, args) {
3820438204 let commitTreeSha = args.tree;
3820538205 if (args.files.length > 0) {
38206- console.log('Creating commit tree ...');
38206+ console.log('Creating blobs ...');
3820738207 let progress = 0;
3820838208 const commitTreeBlobs = await Promise.all(args.files.map(async ({ path, mode, status, loadContent }) => (async function () {
3820938209 switch (status) {
@@ -38240,14 +38240,22 @@ async function createCommit(octokit, repository, args) {
3824038240 })().finally(() => {
3824138241 progress++;
3824238242 // log progress
38243- console.log(`${progress} of ${args.files.length} files...`);
38243+ console.log(` ${progress} of ${args.files.length} files...`);
3824438244 })));
38245- commitTreeSha = await octokit.rest.git.createTree({
38246- ...repository,
38247- base_tree: args.parents[0],
38248- tree: commitTreeBlobs,
38249- }).then(({ data }) => data.sha);
38250- console.log('Creating commit tree done.', commitTreeSha);
38245+ console.log('Creating commit tree...');
38246+ const chunkSize = 100;
38247+ for (let i = 0; i < commitTreeBlobs.length; i += chunkSize) {
38248+ const chunk = commitTreeBlobs.slice(i, i + chunkSize);
38249+ commitTreeSha = await octokit.rest.git.createTree({
38250+ ...repository,
38251+ base_tree: commitTreeSha,
38252+ tree: chunk,
38253+ }).then(({ data }) => data.sha).finally(() => {
38254+ progress++;
38255+ // log progress
38256+ console.log(` ${progress} of ${args.files.length} blobs...`);
38257+ });
38258+ }
3825138259 }
3825238260 console.log('Creating commit...');
3825338261 const commit = await octokit.rest.git.createCommit({
0 commit comments