@@ -79,7 +79,7 @@ func (self *RefsHelper) CheckoutRef(ref string, options types.CheckoutRefOptions
7979 Prompt : self .c .Tr .AutoStashPrompt ,
8080 HandleConfirm : func () error {
8181 return withCheckoutStatus (func (gocui.Task ) error {
82- if err := self .c .Git ().Stash .Push (self .c .Tr .StashPrefix + ref ); err != nil {
82+ if err := self .c .Git ().Stash .Push (fmt . Sprintf ( self .c .Tr .AutoStashForCheckout , ref ) ); err != nil {
8383 return err
8484 }
8585 if err := self .c .Git ().Branch .Checkout (ref , cmdOptions ); err != nil {
@@ -355,7 +355,7 @@ func (self *RefsHelper) NewBranch(from string, fromFormattedName string, suggest
355355 Title : self .c .Tr .AutoStashTitle ,
356356 Prompt : self .c .Tr .AutoStashPrompt ,
357357 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 {
359359 return err
360360 }
361361 if err := newBranchFunc (newBranchName , from ); err != nil {
@@ -389,7 +389,7 @@ func (self *RefsHelper) MoveCommitsToNewBranch() error {
389389 return err
390390 }
391391
392- withNewBranchNamePrompt := func (baseBranchName string , f func (string , string ) error ) error {
392+ withNewBranchNamePrompt := func (baseBranchName string , f func (string ) error ) error {
393393 prompt := utils .ResolvePlaceholderString (
394394 self .c .Tr .NewBranchNameBranchOff ,
395395 map [string ]string {
@@ -408,7 +408,7 @@ func (self *RefsHelper) MoveCommitsToNewBranch() error {
408408 self .c .LogAction (self .c .Tr .MoveCommitsToNewBranch )
409409 newBranchName := SanitizedBranchName (response )
410410 return self .c .WithWaitingStatus (self .c .Tr .MovingCommitsToNewBranchStatus , func (gocui.Task ) error {
411- return f (currentBranch . Name , newBranchName )
411+ return f (newBranchName )
412412 })
413413 },
414414 })
@@ -447,8 +447,8 @@ func (self *RefsHelper) MoveCommitsToNewBranch() error {
447447 {
448448 Label : fmt .Sprintf (self .c .Tr .MoveCommitsToNewBranchFromBaseItem , shortBaseBranchName ),
449449 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 )
452452 })
453453 },
454454 },
@@ -462,14 +462,14 @@ func (self *RefsHelper) MoveCommitsToNewBranch() error {
462462 })
463463}
464464
465- func (self * RefsHelper ) moveCommitsToNewBranchStackedOnCurrentBranch (currentBranch string , newBranchName string ) error {
465+ func (self * RefsHelper ) moveCommitsToNewBranchStackedOnCurrentBranch (newBranchName string ) error {
466466 if err := self .c .Git ().Branch .NewWithoutCheckout (newBranchName , "HEAD" ); err != nil {
467467 return err
468468 }
469469
470470 mustStash := IsWorkingTreeDirty (self .c .Model ().Files )
471471 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 {
473473 return err
474474 }
475475 }
@@ -495,14 +495,14 @@ func (self *RefsHelper) moveCommitsToNewBranchStackedOnCurrentBranch(currentBran
495495 return nil
496496}
497497
498- func (self * RefsHelper ) moveCommitsToNewBranchOffOfMainBranch (currentBranch string , newBranchName string , baseBranchRef string ) error {
498+ func (self * RefsHelper ) moveCommitsToNewBranchOffOfMainBranch (newBranchName string , baseBranchRef string ) error {
499499 commitsToCherryPick := lo .Filter (self .c .Model ().Commits , func (commit * models.Commit , _ int ) bool {
500500 return commit .Status == models .StatusUnpushed
501501 })
502502
503503 mustStash := IsWorkingTreeDirty (self .c .Model ().Files )
504504 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 {
506506 return err
507507 }
508508 }
0 commit comments