replicas-engine 0.1.12 → 0.1.13

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/src/index.js CHANGED
@@ -602,7 +602,9 @@ function getCurrentBranch(cwd) {
602
602
  }
603
603
  function getGitDiff(cwd) {
604
604
  try {
605
- const shortstat = execSync("git diff --shortstat -M", {
605
+ const defaultBranch = process.env.REPLICAS_DEFAULT_BRANCH || "main";
606
+ const baseBranch = `origin/${defaultBranch}`;
607
+ const shortstat = execSync(`git diff ${baseBranch}...HEAD --shortstat -M`, {
606
608
  cwd,
607
609
  encoding: "utf-8",
608
610
  stdio: ["pipe", "pipe", "pipe"]
@@ -617,7 +619,7 @@ function getGitDiff(cwd) {
617
619
  if (removedMatch) {
618
620
  removed = parseInt(removedMatch[1], 10);
619
621
  }
620
- const fullDiff = execSync("git diff -M -C", {
622
+ const fullDiff = execSync(`git diff ${baseBranch}...HEAD -M -C`, {
621
623
  cwd,
622
624
  encoding: "utf-8",
623
625
  stdio: ["pipe", "pipe", "pipe"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",