Skip to content

Commit 8e39ebb

Browse files
committed
refactor: rename isFinalCheckout to isLatestBranch (prereq)
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
1 parent 7d0669f commit 8e39ebb

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

apply.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ const defaultApplyAction: ActionInsideEachCheckedOutBranch = async ({
3333
repo, //
3434
// targetBranch,
3535
targetCommitSHA,
36-
isFinalCheckout,
36+
isLatestBranch,
3737
// execSyncInRepo,
3838
}) => {
3939
const commit: Git.Commit = await Git.Commit.lookup(repo, targetCommitSHA);
4040

4141
console.log("will reset to commit", commit.sha(), "(" + commit.summary() + ")");
4242

43-
console.log({ isFinalCheckout });
43+
console.log({ isLatestBranch });
4444

45-
if (!isFinalCheckout) {
45+
if (!isLatestBranch) {
4646
await Git.Reset.reset(repo, commit, Git.Reset.TYPE.HARD, {});
4747

4848
// if (previousTargetBranchName) {

branchSequencer.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export type ActionInsideEachCheckedOutBranchCtx = {
208208
repo: Git.Repository; //
209209
targetBranch: string;
210210
targetCommitSHA: string;
211-
isFinalCheckout: boolean;
211+
isLatestBranch: boolean;
212212
execSyncInRepo: ReturnType<typeof createExecSyncInRepo>;
213213
};
214214
export type ActionInsideEachCheckedOutBranch = (ctx: ActionInsideEachCheckedOutBranchCtx) => void | Promise<void>;
@@ -341,10 +341,7 @@ export const branchSequencer: BranchSequencer = async ({
341341

342342
// console.log({ targetCommitSHA, target: targetBranch });
343343

344-
/**
345-
* meaning we're on the latest branch
346-
*/
347-
const isFinalCheckout: boolean = boundaries.length === 1;
344+
const isLatestBranch: boolean = boundaries.length === 1;
348345

349346
/**
350347
* https://libgit2.org/libgit2/#HEAD/group/checkout/git_checkout_head
@@ -356,7 +353,7 @@ export const branchSequencer: BranchSequencer = async ({
356353
repo, //
357354
targetBranch,
358355
targetCommitSHA,
359-
isFinalCheckout,
356+
isLatestBranch,
360357
execSyncInRepo,
361358
});
362359

0 commit comments

Comments
 (0)