@@ -355,7 +355,7 @@ func (self *RefsHelper) NewBranch(from string, fromFormattedName string, suggest
355
355
Title : self .c .Tr .AutoStashTitle ,
356
356
Prompt : self .c .Tr .AutoStashPrompt ,
357
357
HandleConfirm : func () error {
358
- if err := self .c .Git ().Stash .Push (self .c .Tr .StashPrefix + newBranchName ); err != nil {
358
+ if err := self .c .Git ().Stash .Push (fmt . Sprintf ( self .c .Tr .AutoStashForNewBranch , newBranchName ) ); err != nil {
359
359
return err
360
360
}
361
361
if err := newBranchFunc (newBranchName , from ); err != nil {
@@ -389,7 +389,7 @@ func (self *RefsHelper) MoveCommitsToNewBranch() error {
389
389
return err
390
390
}
391
391
392
- withNewBranchNamePrompt := func (baseBranchName string , f func (string , string ) error ) error {
392
+ withNewBranchNamePrompt := func (baseBranchName string , f func (string ) error ) error {
393
393
prompt := utils .ResolvePlaceholderString (
394
394
self .c .Tr .NewBranchNameBranchOff ,
395
395
map [string ]string {
@@ -408,7 +408,7 @@ func (self *RefsHelper) MoveCommitsToNewBranch() error {
408
408
self .c .LogAction (self .c .Tr .MoveCommitsToNewBranch )
409
409
newBranchName := SanitizedBranchName (response )
410
410
return self .c .WithWaitingStatus (self .c .Tr .MovingCommitsToNewBranchStatus , func (gocui.Task ) error {
411
- return f (currentBranch . Name , newBranchName )
411
+ return f (newBranchName )
412
412
})
413
413
},
414
414
})
@@ -447,8 +447,8 @@ func (self *RefsHelper) MoveCommitsToNewBranch() error {
447
447
{
448
448
Label : fmt .Sprintf (self .c .Tr .MoveCommitsToNewBranchFromBaseItem , shortBaseBranchName ),
449
449
OnPress : func () error {
450
- return withNewBranchNamePrompt (shortBaseBranchName , func (currentBranch string , newBranchName string ) error {
451
- return self .moveCommitsToNewBranchOffOfMainBranch (currentBranch , newBranchName , baseBranchRef )
450
+ return withNewBranchNamePrompt (shortBaseBranchName , func (newBranchName string ) error {
451
+ return self .moveCommitsToNewBranchOffOfMainBranch (newBranchName , baseBranchRef )
452
452
})
453
453
},
454
454
},
@@ -462,14 +462,14 @@ func (self *RefsHelper) MoveCommitsToNewBranch() error {
462
462
})
463
463
}
464
464
465
- func (self * RefsHelper ) moveCommitsToNewBranchStackedOnCurrentBranch (currentBranch string , newBranchName string ) error {
465
+ func (self * RefsHelper ) moveCommitsToNewBranchStackedOnCurrentBranch (newBranchName string ) error {
466
466
if err := self .c .Git ().Branch .NewWithoutCheckout (newBranchName , "HEAD" ); err != nil {
467
467
return err
468
468
}
469
469
470
470
mustStash := IsWorkingTreeDirty (self .c .Model ().Files )
471
471
if mustStash {
472
- if err := self .c .Git ().Stash .Push (self .c .Tr .StashPrefix + currentBranch ); err != nil {
472
+ if err := self .c .Git ().Stash .Push (fmt . Sprintf ( self .c .Tr .AutoStashForNewBranch , newBranchName ) ); err != nil {
473
473
return err
474
474
}
475
475
}
@@ -495,14 +495,14 @@ func (self *RefsHelper) moveCommitsToNewBranchStackedOnCurrentBranch(currentBran
495
495
return nil
496
496
}
497
497
498
- func (self * RefsHelper ) moveCommitsToNewBranchOffOfMainBranch (currentBranch string , newBranchName string , baseBranchRef string ) error {
498
+ func (self * RefsHelper ) moveCommitsToNewBranchOffOfMainBranch (newBranchName string , baseBranchRef string ) error {
499
499
commitsToCherryPick := lo .Filter (self .c .Model ().Commits , func (commit * models.Commit , _ int ) bool {
500
500
return commit .Status == models .StatusUnpushed
501
501
})
502
502
503
503
mustStash := IsWorkingTreeDirty (self .c .Model ().Files )
504
504
if mustStash {
505
- if err := self .c .Git ().Stash .Push (self .c .Tr .StashPrefix + currentBranch ); err != nil {
505
+ if err := self .c .Git ().Stash .Push (fmt . Sprintf ( self .c .Tr .AutoStashForNewBranch , newBranchName ) ); err != nil {
506
506
return err
507
507
}
508
508
}
0 commit comments