@@ -63,23 +63,19 @@ const defaultApplyAction: ActionInsideEachCheckedOutBranch = async ({
6363export const getBackupPathOfPreviousStackedRebase = ( pathToStackedRebaseDirInsideDotGit : string ) : string =>
6464 pathToStackedRebaseDirInsideDotGit + ".previous" ;
6565
66- export type ReturnOfApplyIfNeedsToApply = {
67- markThatNeedsToApply : ( ) => void ;
68- } & (
66+ export type ReturnOfApplyIfNeedsToApply =
6967 | {
7068 neededToApply : false ;
7169 userAllowedToApplyAndWeApplied ?: never ;
7270 }
7371 | {
7472 neededToApply : true ;
7573 userAllowedToApplyAndWeApplied : false ;
76- // markThatNeedsToApply?: never; // TODO TS infer auto - force code owner to exit
7774 }
7875 | {
7976 neededToApply : true ;
8077 userAllowedToApplyAndWeApplied : true ;
81- }
82- ) ;
78+ } ;
8379export async function applyIfNeedsToApply ( {
8480 repo,
8581 pathToStackedRebaseTodoFile,
@@ -92,16 +88,12 @@ export async function applyIfNeedsToApply({
9288 config : Git . Config ;
9389} ) : Promise < ReturnOfApplyIfNeedsToApply > {
9490 const needsToApply : boolean = doesNeedToApply ( pathToStackedRebaseDirInsideDotGit ) ;
95- const _markThatNeedsToApply = ( ) : void => markThatNeedsToApply ( pathToStackedRebaseDirInsideDotGit ) ;
9691
9792 if ( ! needsToApply ) {
9893 return {
9994 neededToApply : false ,
100- markThatNeedsToApply : _markThatNeedsToApply ,
10195 } ;
102- }
103-
104- if ( needsToApply ) {
96+ } else {
10597 if ( ! autoApplyIfNeeded ) {
10698 const question = createQuestion ( ) ;
10799
@@ -119,7 +111,6 @@ export async function applyIfNeedsToApply({
119111 return {
120112 neededToApply : true ,
121113 userAllowedToApplyAndWeApplied : false ,
122- markThatNeedsToApply : _markThatNeedsToApply ,
123114 } ;
124115 }
125116
@@ -139,7 +130,6 @@ export async function applyIfNeedsToApply({
139130 return {
140131 neededToApply : true ,
141132 userAllowedToApplyAndWeApplied : true , //
142- markThatNeedsToApply : _markThatNeedsToApply ,
143133 } ;
144134}
145135
@@ -219,9 +209,7 @@ const doesNeedToApply = (pathToStackedRebaseDirInsideDotGit: string): boolean =>
219209 return needsToApplyPart2 ;
220210} ;
221211
222- export function readRewrittenListNotAppliedOrAppliedOrError (
223- repoPath : string
224- ) : {
212+ export function readRewrittenListNotAppliedOrAppliedOrError ( repoPath : string ) : {
225213 pathOfRewrittenList : string ;
226214 pathOfRewrittenListApplied : string ;
227215 rewrittenListRaw : string ;
@@ -243,9 +231,7 @@ export function readRewrittenListNotAppliedOrAppliedOrError(
243231 } else if ( fs . existsSync ( pathOfRewrittenListApplied ) ) {
244232 rewrittenListRaw = fs . readFileSync ( pathOfRewrittenListApplied , { encoding : "utf-8" } ) ;
245233 } else {
246- throw new Error (
247- `rewritten-list not found neither in ${ pathOfRewrittenList } , nor in ${ pathOfRewrittenListApplied } `
248- ) ;
234+ throw new Error ( `rewritten-list not found neither in ${ pathOfRewrittenList } , nor in ${ pathOfRewrittenListApplied } ` ) ;
249235 }
250236
251237 const { combinedRewrittenList } = combineRewrittenLists ( rewrittenListRaw ) ;
0 commit comments