Skip to content

Commit a6bc936

Browse files
committed
Revert "fix: create initial gitRebaseTodo _before_ options.push|branchSequencer"
This reverts commit 7c6d15d.
1 parent 7c6d15d commit a6bc936

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

git-stacked-rebase.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -192,29 +192,6 @@ export const gitStackedRebase = async (
192192
return;
193193
}
194194

195-
fs.mkdirSync(pathToStackedRebaseDirInsideDotGit, { recursive: true });
196-
197-
const initialBranch: Git.Reference | void = await Git.Branch.lookup(
198-
repo, //
199-
nameOfInitialBranch,
200-
Git.Branch.BRANCH.ALL
201-
);
202-
const currentBranch: Git.Reference = await repo.getCurrentBranch();
203-
204-
const wasRegularRebaseInProgress: boolean = fs.existsSync(pathToRegularRebaseDirInsideDotGit);
205-
// const
206-
207-
console.log({ wasRegularRebaseInProgress });
208-
209-
if (!wasRegularRebaseInProgress) {
210-
await createInitialEditTodoOfGitStackedRebase(
211-
repo, //
212-
initialBranch,
213-
// __default__pathToStackedRebaseTodoFile
214-
pathToStackedRebaseTodoFile
215-
);
216-
}
217-
218195
if (options.push) {
219196
if (!options.forcePush) {
220197
return fail("\npush without --force will fail (since git rebase overrides history).\n\n");
@@ -251,6 +228,29 @@ export const gitStackedRebase = async (
251228
}
252229
}
253230

231+
fs.mkdirSync(pathToStackedRebaseDirInsideDotGit, { recursive: true });
232+
233+
const initialBranch: Git.Reference | void = await Git.Branch.lookup(
234+
repo, //
235+
nameOfInitialBranch,
236+
Git.Branch.BRANCH.ALL
237+
);
238+
const currentBranch: Git.Reference = await repo.getCurrentBranch();
239+
240+
const wasRegularRebaseInProgress: boolean = fs.existsSync(pathToRegularRebaseDirInsideDotGit);
241+
// const
242+
243+
console.log({ wasRegularRebaseInProgress });
244+
245+
if (!wasRegularRebaseInProgress) {
246+
await createInitialEditTodoOfGitStackedRebase(
247+
repo, //
248+
initialBranch,
249+
// __default__pathToStackedRebaseTodoFile
250+
pathToStackedRebaseTodoFile
251+
);
252+
}
253+
254254
if (!wasRegularRebaseInProgress || options.viewTodoOnly) {
255255
if (options.editor instanceof Function) {
256256
await options.editor({ filePath: pathToStackedRebaseTodoFile });

0 commit comments

Comments
 (0)