Skip to content

Commit 75fc9e5

Browse files
committed
fix: move gitRebaseTodo into .applied when applied
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
1 parent 0a145d8 commit 75fc9e5

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

apply.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,13 @@ export const unmarkThatNeedsToApply = (
114114
pathToStackedRebaseDirInsideDotGit: string,
115115
mark = getPathOfFilenameOfNeedsToApply(pathToStackedRebaseDirInsideDotGit),
116116
rewrittenListFile: string = path.join(pathToStackedRebaseDirInsideDotGit, filenames.rewrittenList),
117-
rewrittenListAppliedFile: string = path.join(pathToStackedRebaseDirInsideDotGit, filenames.rewrittenListApplied)
117+
rewrittenListAppliedFile: string = path.join(pathToStackedRebaseDirInsideDotGit, filenames.rewrittenListApplied),
118+
gitRebaseTodoFile: string = path.join(pathToStackedRebaseDirInsideDotGit, filenames.gitRebaseTodo),
119+
gitRebaseTodoAppliedFile: string = path.join(pathToStackedRebaseDirInsideDotGit, filenames.gitRebaseTodoApplied)
118120
): void => (
119121
fs.existsSync(mark) && fs.unlinkSync(mark),
120122
fs.existsSync(rewrittenListFile) && fs.renameSync(rewrittenListFile, rewrittenListAppliedFile),
123+
fs.existsSync(gitRebaseTodoFile) && fs.renameSync(gitRebaseTodoFile, gitRebaseTodoAppliedFile),
121124
void 0
122125
);
123126

@@ -150,9 +153,15 @@ export async function applyIfNeedsToApply({
150153
filenames.rewrittenListApplied
151154
);
152155

156+
const pathToAppliedGitRebaseTodoFile = path.join(
157+
pathToStackedRebaseDirInsideDotGit,
158+
filenames.gitRebaseTodoApplied
159+
);
160+
153161
const markThatNeedsToApply = (): void => (
154162
fs.writeFileSync(pathToFileIndicatingThatNeedsToApply, ""),
155163
fs.existsSync(pathToAppliedRewrittenListFile) && fs.unlinkSync(pathToAppliedRewrittenListFile),
164+
fs.existsSync(pathToAppliedGitRebaseTodoFile) && fs.unlinkSync(pathToAppliedGitRebaseTodoFile),
156165
void 0
157166
);
158167

filenames.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const filenames = {
66
rewrittenListApplied: "rewritten-list.applied",
77
//
88
gitRebaseTodo: "git-rebase-todo",
9+
gitRebaseTodoApplied: "git-rebase-todo.applied",
910
//
1011

1112
/**

0 commit comments

Comments
 (0)