@wrongstack/tools 0.87.0 → 0.89.1

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/builtin.js CHANGED
@@ -4471,7 +4471,20 @@ var gitTool = {
4471
4471
  };
4472
4472
  }
4473
4473
  const args = buildArgs(input);
4474
- return await runGit2(args, gitDir, opts.signal);
4474
+ let stagedDiff;
4475
+ if (input.command === "commit" && !input.dry_run) {
4476
+ try {
4477
+ const diffResult = await runGit2(["diff", "--cached"], gitDir, opts.signal);
4478
+ if (diffResult.exitCode === 0) {
4479
+ const MAX_DIFF = 2e4;
4480
+ stagedDiff = diffResult.stdout.length > MAX_DIFF ? diffResult.stdout.slice(0, MAX_DIFF) + "\n\n... (diff truncated)" : diffResult.stdout;
4481
+ }
4482
+ } catch {
4483
+ }
4484
+ }
4485
+ const result = await runGit2(args, gitDir, opts.signal);
4486
+ if (stagedDiff !== void 0) result.diff = stagedDiff;
4487
+ return result;
4475
4488
  }
4476
4489
  };
4477
4490
  function validateWorktreeInput(input, projectRoot) {