File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,22 @@ export const markThatApplied = (pathToStackedRebaseDirInsideDotGit: string): voi
190190 [ getPaths ( pathToStackedRebaseDirInsideDotGit ) ] . map (
191191 ( { rewrittenListPath, needsToApplyPath, appliedPath } ) => (
192192 fs . existsSync ( needsToApplyPath ) && fs . unlinkSync ( needsToApplyPath ) , //
193- fs . renameSync ( rewrittenListPath , appliedPath ) ,
193+ /**
194+ * need to check if the `rewrittenListPath` exists,
195+ * because even if it does not, then the "apply" can still go through
196+ * and "apply", by using the already .applied file, i.e. do nothing.
197+ *
198+ * TODO just do not run "apply" if the file doesn't exist?
199+ * or is there a case where it's useful still?
200+ *
201+ */
202+ fs . existsSync ( rewrittenListPath ) && fs . renameSync ( rewrittenListPath , appliedPath ) ,
203+ // fs.existsSync(rewrittenListPath)
204+ // ? fs.renameSync(rewrittenListPath, appliedPath)
205+ // : !fs.existsSync(appliedPath) &&
206+ // (() => {
207+ // throw new Error("applying uselessly");
208+ // })(),
194209 void 0
195210 )
196211 ) [ 0 ] ;
You can’t perform that action at this time.
0 commit comments