@@ -11,7 +11,7 @@ import { bullets } from "nice-comment";
1111
1212import  {  filenames  }  from  "./filenames" ; 
1313import  {  configKeys  }  from  "./configKeys" ; 
14- import  {  apply ,  applyIfNeedsToApply  }  from  "./apply" ; 
14+ import  {  apply ,  applyIfNeedsToApply ,   markThatNeedsToApply   as   _markThatNeedsToApply  }  from  "./apply" ; 
1515import  {  forcePush  }  from  "./forcePush" ; 
1616import  {  branchSequencer  }  from  "./branchSequencer" ; 
1717
@@ -284,6 +284,10 @@ export const gitStackedRebase = async (
284284		const  pathToStackedRebaseDirInsideDotGit : string  =  parsed . pathToStackedRebaseDirInsideDotGit ; 
285285		const  pathToStackedRebaseTodoFile : string  =  parsed . pathToStackedRebaseTodoFile ; 
286286
287+ 		if  ( fs . existsSync ( path . join ( pathToStackedRebaseDirInsideDotGit ,  filenames . willNeedToApply ) ) )  { 
288+ 			_markThatNeedsToApply ( pathToStackedRebaseDirInsideDotGit ) ; 
289+ 		} 
290+ 
287291		if  ( options . apply )  { 
288292			return  await  apply ( { 
289293				repo, 
@@ -704,7 +708,7 @@ mv -f "${preparedRegularRebaseTodoFile}" "${pathToRegularRebaseTodoFile}"
704708		/** 
705709		 * will need to apply, unless proven otherwise 
706710		 */ 
707- 		markThatNeedsToApply ( ) ; 
711+ 		fs . writeFileSync ( path . join ( pathToStackedRebaseDirInsideDotGit ,   filenames . willNeedToApply ) ,   "" ) ; 
708712
709713		/** 
710714		 * part 2 of "the different ways to launch git rebase" 
@@ -780,11 +784,14 @@ mv -f "${preparedRegularRebaseTodoFile}" "${pathToRegularRebaseTodoFile}"
780784		} ) ; 
781785		console . log ( "" ) ; 
782786
783- 		if  ( ! rebaseChangedLocalHistory )  { 
784- 			/** 
785- 			 * TODO `unmarkThatNeedsToApply` (NOT the same as `markThatApplied`!) 
786- 			 */ 
787- 			// unmarkThatNeedsToApply(); 
787+ 		fs . unlinkSync ( path . join ( pathToStackedRebaseDirInsideDotGit ,  filenames . willNeedToApply ) ) ; 
788+ 		if  ( rebaseChangedLocalHistory )  { 
789+ 			markThatNeedsToApply ( ) ; 
790+ 		}  else  { 
791+ 			// /** 
792+ 			//  * TODO `unmarkThatNeedsToApply` (NOT the same as `markThatApplied`!) 
793+ 			//  */ 
794+ 			// // unmarkThatNeedsToApply(); 
788795		} 
789796
790797		/** 
0 commit comments