@@ -11,7 +11,7 @@ import { bullets } from "nice-comment";
11
11
12
12
import { filenames } from "./filenames" ;
13
13
import { configKeys } from "./configKeys" ;
14
- import { apply , applyIfNeedsToApply } from "./apply" ;
14
+ import { apply , applyIfNeedsToApply , markThatNeedsToApply as _markThatNeedsToApply } from "./apply" ;
15
15
import { forcePush } from "./forcePush" ;
16
16
import { branchSequencer } from "./branchSequencer" ;
17
17
@@ -284,6 +284,10 @@ export const gitStackedRebase = async (
284
284
const pathToStackedRebaseDirInsideDotGit : string = parsed . pathToStackedRebaseDirInsideDotGit ;
285
285
const pathToStackedRebaseTodoFile : string = parsed . pathToStackedRebaseTodoFile ;
286
286
287
+ if ( fs . existsSync ( path . join ( pathToStackedRebaseDirInsideDotGit , filenames . willNeedToApply ) ) ) {
288
+ _markThatNeedsToApply ( pathToStackedRebaseDirInsideDotGit ) ;
289
+ }
290
+
287
291
if ( options . apply ) {
288
292
return await apply ( {
289
293
repo,
@@ -701,7 +705,7 @@ mv -f "${preparedRegularRebaseTodoFile}" "${pathToRegularRebaseTodoFile}"
701
705
/**
702
706
* will need to apply, unless proven otherwise
703
707
*/
704
- markThatNeedsToApply ( ) ;
708
+ fs . writeFileSync ( path . join ( pathToStackedRebaseDirInsideDotGit , filenames . willNeedToApply ) , "" ) ;
705
709
706
710
/**
707
711
* part 2 of "the different ways to launch git rebase"
@@ -775,11 +779,14 @@ mv -f "${preparedRegularRebaseTodoFile}" "${pathToRegularRebaseTodoFile}"
775
779
} ) ;
776
780
console . log ( "" ) ;
777
781
778
- if ( ! rebaseChangedLocalHistory ) {
779
- /**
780
- * TODO `unmarkThatNeedsToApply` (NOT the same as `markThatApplied`!)
781
- */
782
- // unmarkThatNeedsToApply();
782
+ fs . unlinkSync ( path . join ( pathToStackedRebaseDirInsideDotGit , filenames . willNeedToApply ) ) ;
783
+ if ( rebaseChangedLocalHistory ) {
784
+ markThatNeedsToApply ( ) ;
785
+ } else {
786
+ // /**
787
+ // * TODO `unmarkThatNeedsToApply` (NOT the same as `markThatApplied`!)
788
+ // */
789
+ // // unmarkThatNeedsToApply();
783
790
}
784
791
785
792
/**
0 commit comments