Skip to content

Commit 7d9d5e8

Browse files
committed
TEMP
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
1 parent afb90de commit 7d9d5e8

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

git-stacked-rebase.ts

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,7 @@ async function extendCommitsWithBranchEnds(
13941394
const removeRemoteRegex = /^refs\/remotes\/[^/]*\//;
13951395

13961396
const currentBranchCommit: Git.Oid = await referenceToOid(currentBranch);
1397+
noop(currentBranchCommit);
13971398

13981399
const extend = (c: Git.Commit, i: number): CommitAndBranchBoundary => (
13991400
(matchedRefs = refs.filter((ref) => !!ref.target()?.equal(c.id()))),
@@ -1425,35 +1426,36 @@ async function extendCommitsWithBranchEnds(
14251426
.map((ref) => ref.name().replace(removeLocalRegex, ""))
14261427
.includes(r.name().replace(removeRemoteRegex, ""))
14271428
)),
1428-
assert(
1429-
matchedRefs.length <= 1 ||
1430-
/**
1431-
* if it's more than 1,
1432-
* it's only allowed if all of the branches are the same ones,
1433-
* just on different remotes.
1434-
*/
1435-
(matchedRefs.length > 1 &&
1436-
uniq(
1437-
matchedRefs.map((r) =>
1438-
r
1439-
?.name()
1440-
.replace(removeLocalRegex, "")
1441-
.replace(removeRemoteRegex, "")
1442-
)
1443-
).length === 1),
1444-
// ||
1445-
// /**
1446-
// * or, if it's the root branch
1447-
// */
1448-
// !c.id().cmp(currentBranchCommit),
1449-
"" +
1450-
"2 (or more) branches for the same commit, both in the same path - cannot continue" +
1451-
"(until explicit branch specifying is implemented)" +
1452-
"\n\n" +
1453-
"matchedRefs = " +
1454-
matchedRefs.map((mr) => mr?.name()) +
1455-
"\n"
1456-
),
1429+
// assert(
1430+
// matchedRefs.length <= 1 ||
1431+
// /**
1432+
// * if it's more than 1,
1433+
// * it's only allowed if all of the branches are the same ones,
1434+
// * just on different remotes.
1435+
// */
1436+
// (matchedRefs.length > 1 &&
1437+
// uniq(
1438+
// matchedRefs.map((r) =>
1439+
// r
1440+
// ?.name()
1441+
// .replace(removeLocalRegex, "")
1442+
// .replace(removeRemoteRegex, "")
1443+
// )
1444+
// ).length === 1),
1445+
// // ||
1446+
// // /**
1447+
// // * or, if it's the root branch
1448+
// // */
1449+
// // !c.id().cmp(currentBranchCommit),
1450+
// "" +
1451+
// "2 (or more) branches for the same commit, both in the same path - cannot continue" +
1452+
// "(until explicit branch specifying is implemented)" +
1453+
// "\n\n" +
1454+
// "matchedRefs = " +
1455+
// matchedRefs.map((mr) => mr?.name()) +
1456+
// "\n"
1457+
// ),
1458+
noop(uniq),
14571459
matchedRefs.length > 1 &&
14581460
(matchedRefs = matchedRefs.some((r) => r?.name() === initialBranch.name())
14591461
? [initialBranch]

0 commit comments

Comments
 (0)