vde-worktree 0.0.10 → 0.0.11
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 +10 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -707,8 +707,9 @@ const parseMergedResult = (raw) => {
|
|
|
707
707
|
return null;
|
|
708
708
|
}
|
|
709
709
|
};
|
|
710
|
-
const resolveMergedByPr = async ({ repoRoot, branch, enabled = true, runGh = defaultRunGh }) => {
|
|
710
|
+
const resolveMergedByPr = async ({ repoRoot, branch, baseBranch, enabled = true, runGh = defaultRunGh }) => {
|
|
711
711
|
if (enabled !== true) return null;
|
|
712
|
+
if (baseBranch === null) return null;
|
|
712
713
|
try {
|
|
713
714
|
const result = await runGh({
|
|
714
715
|
cwd: repoRoot,
|
|
@@ -719,6 +720,8 @@ const resolveMergedByPr = async ({ repoRoot, branch, enabled = true, runGh = def
|
|
|
719
720
|
"merged",
|
|
720
721
|
"--head",
|
|
721
722
|
branch,
|
|
723
|
+
"--base",
|
|
724
|
+
baseBranch,
|
|
722
725
|
"--limit",
|
|
723
726
|
"1",
|
|
724
727
|
"--json",
|
|
@@ -902,6 +905,7 @@ const resolveMergedState = async ({ repoRoot, branch, baseBranch, enableGh }) =>
|
|
|
902
905
|
const byPR = await resolveMergedByPr({
|
|
903
906
|
repoRoot,
|
|
904
907
|
branch,
|
|
908
|
+
baseBranch,
|
|
905
909
|
enabled: enableGh
|
|
906
910
|
});
|
|
907
911
|
return {
|
|
@@ -914,9 +918,11 @@ const resolveMergedState = async ({ repoRoot, branch, baseBranch, enableGh }) =>
|
|
|
914
918
|
};
|
|
915
919
|
};
|
|
916
920
|
const resolveMergedOverall = ({ byAncestry, byPR }) => {
|
|
917
|
-
if (byPR === true) return true;
|
|
918
|
-
if (byPR === false) return false;
|
|
919
|
-
return byAncestry;
|
|
921
|
+
if (byAncestry === true || byPR === true) return true;
|
|
922
|
+
if (byAncestry === false && byPR === false) return false;
|
|
923
|
+
if (byAncestry !== null) return byAncestry;
|
|
924
|
+
if (byPR !== null) return byPR;
|
|
925
|
+
return null;
|
|
920
926
|
};
|
|
921
927
|
const resolveUpstreamState = async (worktreePath) => {
|
|
922
928
|
const upstreamRef = await runGitCommand({
|