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 +4 -2
- package/package.json +1 -1
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
|
|
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(
|
|
622
|
+
const fullDiff = execSync(`git diff ${baseBranch}...HEAD -M -C`, {
|
|
621
623
|
cwd,
|
|
622
624
|
encoding: "utf-8",
|
|
623
625
|
stdio: ["pipe", "pipe", "pipe"]
|