Skip to content

Commit 1dab3e8

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 <[email protected]>
1 parent 51301f0 commit 1dab3e8

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
@@ -614,9 +614,9 @@ export const gitStackedRebase = async (
614614
"invalid old name of command in git-rebase-todo file"
615615
);
616616
words[0] = newName;
617-
console.log({ before: linesOfEditedRebaseTodo[oldLatestBranchCmd.lineNumber] });
618-
linesOfEditedRebaseTodo[oldLatestBranchCmd.lineNumber] = words.join(" ");
619-
console.log({ after: linesOfEditedRebaseTodo[oldLatestBranchCmd.lineNumber] });
617+
console.log({ before: linesOfEditedRebaseTodo[cmd.lineNumber] });
618+
linesOfEditedRebaseTodo[cmd.lineNumber] = words.join(" ");
619+
console.log({ after: linesOfEditedRebaseTodo[cmd.lineNumber] });
620620
}
621621

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

0 commit comments

Comments
 (0)