Skip to content

Commit 5fac74b

Browse files
committed
fix: use the provided cmd
previously would just change to the correct thing, and then change back to the wrong one, because fn called twice for diff things, that's why the git-rebase-todo file looked the same Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
1 parent 3a5ee34 commit 5fac74b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

git-stacked-rebase.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,9 +613,9 @@ export const gitStackedRebase = async (
613613
`invalid old name of command in git-rebase-todo file. got "${words[0]}", expected one of "${allowedOldName}".`
614614
);
615615
words[0] = newName;
616-
console.log({ before: linesOfEditedRebaseTodo[oldLatestBranchCmd.lineNumber] });
617-
linesOfEditedRebaseTodo[oldLatestBranchCmd.lineNumber] = words.join(" ");
618-
console.log({ after: linesOfEditedRebaseTodo[oldLatestBranchCmd.lineNumber] });
616+
console.log({ before: linesOfEditedRebaseTodo[cmd.lineNumber] });
617+
linesOfEditedRebaseTodo[cmd.lineNumber] = words.join(" ");
618+
console.log({ after: linesOfEditedRebaseTodo[cmd.lineNumber] });
619619
}
620620

621621
fs.writeFileSync(pathToStackedRebaseTodoFile, linesOfEditedRebaseTodo.join("\n"), { encoding: "utf-8" });

0 commit comments

Comments
 (0)