@@ -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,21 +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+ console.log('Creating commit tree...');
3824538246 const chunkSize = 100;
38246- let currentBaseTree = args.parents[0];
3824738247 for (let i = 0; i < commitTreeBlobs.length; i += chunkSize) {
3824838248 const chunk = commitTreeBlobs.slice(i, i + chunkSize);
38249- console.log(`Creating commit tree (${i + chunk.length} of ${commitTreeBlobs.length})...`);
38250- currentBaseTree = await octokit.rest.git.createTree({
38249+ commitTreeSha = await octokit.rest.git.createTree({
3825138250 ...repository,
38252- base_tree: currentBaseTree ,
38251+ base_tree: commitTreeSha ,
3825338252 tree: chunk,
38254- }).then(({ data }) => data.sha);
38253+ }).then(({ data }) => data.sha).finally(() => {
38254+ progress++;
38255+ // log progress
38256+ console.log(` ${progress} of ${args.files.length} blobs...`);
38257+ });
3825538258 }
38256- commitTreeSha = currentBaseTree;
38257- console.log('Creating commit tree done.', commitTreeSha);
3825838259 }
3825938260 console.log('Creating commit...');
3826038261 const commit = await octokit.rest.git.createCommit({
0 commit comments