Skip to content

Commit 2f8192d

Browse files
committed
rename goodCommands to oldGoodCommands
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
1 parent b0aea0f commit 2f8192d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

parse-todo-of-stacked-rebase/parseNewGoodCommands.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export function parseNewGoodCommands(
1616
repo: Git.Repository,
1717
pathToStackedRebaseTodoFile: string //
1818
): GoodCommand[] {
19-
const goodCommands: GoodCommand[] = parseTodoOfStackedRebase(pathToStackedRebaseTodoFile);
19+
const oldGoodCommands: GoodCommand[] = parseTodoOfStackedRebase(pathToStackedRebaseTodoFile);
2020

21-
logGoodCmds(goodCommands);
21+
logGoodCmds(oldGoodCommands);
2222

2323
const pathOfRewrittenList: string = path.join(repo.path(), "stacked-rebase", filenames.rewrittenList);
2424
const rewrittenList: string = fs.readFileSync(pathOfRewrittenList, { encoding: "utf-8" });
@@ -70,15 +70,15 @@ export function parseNewGoodCommands(
7070
*/
7171
const goodNewCommands: GoodCommand[] = [];
7272

73-
goodNewCommands.push(goodCommands[0]);
73+
goodNewCommands.push(oldGoodCommands[0]);
7474

7575
let lastNewCommit: OldCommit | null = null;
7676

7777
let goodCommandMinIndex = 1;
7878
for (let i = 0; i < oldCommits.length; i++) {
7979
const oldCommit: OldCommit = oldCommits[i];
8080

81-
const oldCommandAtIdx: GoodCommand = goodCommands[goodCommandMinIndex];
81+
const oldCommandAtIdx: GoodCommand = oldGoodCommands[goodCommandMinIndex];
8282

8383
if (oldCommandAtIdx.commandName in stackedRebaseCommands) {
8484
goodNewCommands.push({
@@ -88,7 +88,7 @@ export function parseNewGoodCommands(
8888
goodCommandMinIndex++;
8989
}
9090

91-
const goodOldCommand = goodCommands.find((cmd) => cmd.targets?.[0] === oldCommit.oldSHA);
91+
const goodOldCommand = oldGoodCommands.find((cmd) => cmd.targets?.[0] === oldCommit.oldSHA);
9292

9393
if (!goodOldCommand) {
9494
throw new Error("TODO: goodCommandOld not found");
@@ -135,20 +135,20 @@ export function parseNewGoodCommands(
135135
//
136136
}
137137

138-
goodNewCommands.push(goodCommands[goodCommands.length - 1]);
138+
goodNewCommands.push(oldGoodCommands[oldGoodCommands.length - 1]);
139139

140140
// console.log({ goodNewCommands });
141141
console.log({
142-
len: goodCommands.length,
143-
goodCommands: goodCommands.map((c) => c.commandOrAliasName + ": " + c.targets?.join(", ") + "."),
142+
len: oldGoodCommands.length,
143+
goodCommands: oldGoodCommands.map((c) => c.commandOrAliasName + ": " + c.targets?.join(", ") + "."),
144144
});
145145

146146
console.log({
147147
len: goodNewCommands.length,
148148
goodNewCommands: goodNewCommands.map((c) => c.commandOrAliasName + ": " + c.targets?.join(", ") + "."),
149149
});
150150

151-
const stackedRebaseCommandsOld = goodCommands.filter((cmd) => cmd.commandName in stackedRebaseCommands);
151+
const stackedRebaseCommandsOld = oldGoodCommands.filter((cmd) => cmd.commandName in stackedRebaseCommands);
152152
const stackedRebaseCommandsNew: GoodCommand[] = goodNewCommands
153153
.map((cmd, i) =>
154154
cmd.commandName in stackedRebaseCommands

0 commit comments

Comments
 (0)