diff --git a/branchSequencer.ts b/branchSequencer.ts index 37af1067..799d8908 100644 --- a/branchSequencer.ts +++ b/branchSequencer.ts @@ -3,8 +3,6 @@ import assert from "assert"; import Git from "nodegit"; -import { filenames } from "./filenames"; - import { createExecSyncInRepo } from "./util/execSyncInRepo"; import { Termination } from "./util/error"; @@ -54,7 +52,6 @@ export type BranchSequencerArgs = BranchSequencerArgsBase & { actionInsideEachCheckedOutBranch: ActionInsideEachCheckedOutBranch; delayMsBetweenCheckouts?: number; callbackAfterDone?: CallbackAfterDone; - rewrittenListFile?: typeof filenames.rewrittenList; }; export type BranchSequencerBase = (args: BranchSequencerArgsBase) => Promise; @@ -70,18 +67,13 @@ export const branchSequencer: BranchSequencer = async ({ // callbackBeforeBegin, actionInsideEachCheckedOutBranch, callbackAfterDone = (): void => {}, - rewrittenListFile = filenames.rewrittenList, gitCmd, }) => { if (!fs.existsSync(pathToStackedRebaseDirInsideDotGit)) { throw new Termination(`\n\nno stacked-rebase in progress? (nothing to ${rootLevelCommandName})\n\n`); } - const stackedRebaseCommandsNew: GoodCommand[] = parseNewGoodCommands( - repo, - pathToStackedRebaseTodoFile, - rewrittenListFile - ); + const stackedRebaseCommandsNew: GoodCommand[] = parseNewGoodCommands(repo, pathToStackedRebaseTodoFile); // const remotes: Git.Remote[] = await repo.getRemotes(); // const remote: Git.Remote | undefined = remotes.find((r) => diff --git a/forcePush.ts b/forcePush.ts index 171e3720..a7c0befa 100644 --- a/forcePush.ts +++ b/forcePush.ts @@ -38,5 +38,4 @@ export const forcePush: BranchSequencerBase = (argsBase) => execSyncInRepo(`${argsBase.gitCmd} push --force`); }, delayMsBetweenCheckouts: 0, - rewrittenListFile: "rewritten-list.applied", }); diff --git a/parse-todo-of-stacked-rebase/parseNewGoodCommands.ts b/parse-todo-of-stacked-rebase/parseNewGoodCommands.ts index f55ce234..12d8ad8f 100644 --- a/parse-todo-of-stacked-rebase/parseNewGoodCommands.ts +++ b/parse-todo-of-stacked-rebase/parseNewGoodCommands.ts @@ -14,14 +14,13 @@ import { GoodCommand, stackedRebaseCommands } from "./validator"; export function parseNewGoodCommands( repo: Git.Repository, - pathToStackedRebaseTodoFile: string, // - rewrittenListFile: typeof filenames.rewrittenList | typeof filenames.rewrittenListApplied + pathToStackedRebaseTodoFile: string // ): GoodCommand[] { const oldGoodCommands: GoodCommand[] = parseTodoOfStackedRebase(pathToStackedRebaseTodoFile); logGoodCmds(oldGoodCommands); - const pathOfRewrittenList: string = path.join(repo.path(), "stacked-rebase", rewrittenListFile); + const pathOfRewrittenList: string = path.join(repo.path(), "stacked-rebase", filenames.rewrittenList); const rewrittenList: string = fs.readFileSync(pathOfRewrittenList, { encoding: "utf-8" }); const rewrittenListLines: string[] = rewrittenList.split("\n").filter((line) => !!line); @@ -36,7 +35,7 @@ export function parseNewGoodCommands( const fromToSHA = line.split(" "); assert( fromToSHA.length === 2, - `from and to SHAs, coming from ${rewrittenListFile}, are written properly (1 space total).` + `from and to SHAs, coming from ${filenames.rewrittenList}, are written properly (1 space total).` ); const [oldSHA, newSHA] = fromToSHA;