Skip to content

Commit d6b7e8c

Browse files
committed
fix: realize that multiple remotes can exist, thus allow any amount of branches, as long as they're the same one
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
1 parent b9de273 commit d6b7e8c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

git-stacked-rebase.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,12 @@ async function getWantedCommitsWithBranchBoundaries(
903903
(matchedRefs = refs.filter((ref) => !!ref.target()?.equal(c.id()))),
904904
assert(
905905
matchedRefs.length <= 1 ||
906-
(matchedRefs.length === 2 &&
906+
/**
907+
* if it's more than 1,
908+
* it's only allowed all of the branches are the same ones,
909+
* just on different remotes.
910+
*/
911+
(matchedRefs.length > 1 &&
907912
uniq(
908913
matchedRefs.map((r) =>
909914
r
@@ -920,7 +925,7 @@ async function getWantedCommitsWithBranchBoundaries(
920925
matchedRefs.map((mr) => mr?.name()) +
921926
"\n"
922927
),
923-
matchedRefs.length === 2 &&
928+
matchedRefs.length > 1 &&
924929
(matchedRefs = matchedRefs.some((r) => r?.name() === bb.name())
925930
? [bb]
926931
: matchedRefs.filter((r) => !r?.isRemote() /* r?.name().includes("refs/heads/") */)),

0 commit comments

Comments
 (0)