@@ -139,22 +139,19 @@ export class CheckpointService {
139139 }
140140
141141 if ( stashSha ) {
142- console . log ( `[restoreMain] applying stash ${ stashSha } ` )
142+ this . log ( `[restoreMain] applying stash ${ stashSha } ` )
143143 await this . git . raw ( [ "stash" , "apply" , "--index" , stashSha ] )
144144 }
145145
146- console . log ( `[restoreMain] restoring from ${ branch } ` )
146+ this . log ( `[restoreMain] restoring from ${ branch } ` )
147147 await this . git . raw ( [ "restore" , "--source" , branch , "--worktree" , "--" , "." ] )
148148 }
149149
150150 public async saveCheckpoint ( message : string ) {
151151 await this . ensureBranch ( this . mainBranch )
152152
153- const status = await this . git . status ( )
154- console . log ( `[saveCheckpoint] status: ${ JSON . stringify ( status ) } ` )
155153 const stashSha = ( await this . git . raw ( [ "stash" , "create" ] ) ) . trim ( )
156- console . log ( `[saveCheckpoint] stashSha: ${ stashSha } ` )
157- const latestHash = await this . git . revparse ( [ this . hiddenBranch ] )
154+ const latestSha = await this . git . revparse ( [ this . hiddenBranch ] )
158155
159156 /**
160157 * PHASE: Create stash
@@ -220,7 +217,7 @@ export class CheckpointService {
220217 let diff
221218
222219 try {
223- diff = await this . git . diff ( [ latestHash , stashBranch ] )
220+ diff = await this . git . diff ( [ latestSha , stashBranch ] )
224221 } catch ( err ) {
225222 await this . restoreMain ( { branch : stashBranch , stashSha, force : true } )
226223 await this . git . branch ( [ "-D" , stashBranch ] ) . catch ( ( ) => { } )
@@ -292,7 +289,7 @@ export class CheckpointService {
292289 this . currentCheckpoint = commit
293290 this . log ( `[saveCheckpoint] cherry-pick commit = ${ commit } ` )
294291 } catch ( err ) {
295- await this . git . reset ( [ "--hard" , latestHash ] ) . catch ( ( ) => { } )
292+ await this . git . reset ( [ "--hard" , latestSha ] ) . catch ( ( ) => { } )
296293 await this . restoreMain ( { branch : stashBranch , stashSha, force : true } )
297294 await this . git . branch ( [ "-D" , stashBranch ] ) . catch ( ( ) => { } )
298295
0 commit comments