Skip to content

Commit 8d9b63b

Browse files
committed
fix: checkout to the latest branch (since if reversed, would end up at initial)
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
1 parent 3bd6550 commit 8d9b63b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

branchSequencer.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ export const branchSequencer: BranchSequencer = async ({
280280

281281
const originalBoundariesLength: number = branchesAndCommits.length;
282282

283+
const latestBoundary: SimpleBranchAndCommit = branchesAndCommits[branchesAndCommits.length - 1];
284+
283285
if (reverseCheckoutOrder) {
284286
branchesAndCommits.reverse();
285287
}
@@ -288,6 +290,14 @@ export const branchSequencer: BranchSequencer = async ({
288290

289291
async function checkout(boundaries: SimpleBranchAndCommit[]): Promise<void> {
290292
if (!boundaries.length) {
293+
/**
294+
* done.
295+
*
296+
* now just checkout to the latest branch
297+
*/
298+
299+
await repo.checkoutBranch(latestBoundary.branchEndFullName);
300+
291301
return;
292302
}
293303

0 commit comments

Comments
 (0)