@fluid-app/fluid-cli-theme-dev 0.1.56 → 0.1.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -3289,9 +3289,14 @@ var ShadowRepo = class ShadowRepo {
3289
3289
  async commitState(files, message) {
3290
3290
  const indexPath = mkdtempSync(join(tmpdir(), "fluid-shadow-")) + "/index";
3291
3291
  try {
3292
- const indexArgs = ["update-index", "--add"];
3293
- for (const { path, sha } of files) indexArgs.push("--cacheinfo", `100644,${sha},${path}`);
3294
- if (files.length > 0) await this.git(indexArgs, { env: { GIT_INDEX_FILE: indexPath } });
3292
+ if (files.length > 0) await this.git([
3293
+ "update-index",
3294
+ "-z",
3295
+ "--index-info"
3296
+ ], {
3297
+ input: Buffer.from(files.map(({ path, sha }) => `100644 ${sha}\t${path}\0`).join("")),
3298
+ env: { GIT_INDEX_FILE: indexPath }
3299
+ });
3295
3300
  const treeSha = (await this.git(["write-tree"], { env: { GIT_INDEX_FILE: indexPath } })).stdout.toString("utf8").trim();
3296
3301
  const parent = await this.hasHead() ? (await this.git(["rev-parse", "HEAD"])).stdout.toString("utf8").trim() : null;
3297
3302
  const commitArgs = [
@@ -3425,14 +3430,13 @@ var ShadowRepo = class ShadowRepo {
3425
3430
  "pipe"
3426
3431
  ]
3427
3432
  });
3428
- if (opts.input) child.stdin.write(opts.input);
3429
- child.stdin.end();
3430
3433
  return new Promise((resolve, reject) => {
3431
3434
  const stdout = [];
3432
3435
  const stderr = [];
3433
3436
  child.stdout.on("data", (chunk) => stdout.push(chunk));
3434
3437
  child.stderr.on("data", (chunk) => stderr.push(chunk));
3435
3438
  child.on("error", reject);
3439
+ child.stdin.on("error", reject);
3436
3440
  child.on("close", (code) => {
3437
3441
  const out = Buffer.concat(stdout);
3438
3442
  const err = Buffer.concat(stderr);
@@ -3448,6 +3452,7 @@ var ShadowRepo = class ShadowRepo {
3448
3452
  reject(e);
3449
3453
  }
3450
3454
  });
3455
+ child.stdin.end(opts.input);
3451
3456
  });
3452
3457
  }
3453
3458
  };