2023-02-09 18:29:09 +02:00
package branch
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var RebaseDoesNotAutosquash = NewIntegrationTest ( NewIntegrationTestArgs {
Description : "Rebase a branch that has fixups onto another branch, and verify that the fixups are not squashed even if rebase.autoSquash is enabled globally." ,
2023-05-21 09:00:29 +02:00
ExtraCmdArgs : [ ] string { } ,
2023-02-09 18:29:09 +02:00
Skip : false ,
SetupConfig : func ( config * config . AppConfig ) { } ,
SetupRepo : func ( shell * Shell ) {
shell . SetConfig ( "rebase.autoSquash" , "true" )
shell .
EmptyCommit ( "base" ) .
NewBranch ( "my-branch" ) .
Checkout ( "master" ) .
EmptyCommit ( "master commit" ) .
Checkout ( "my-branch" ) .
EmptyCommit ( "branch commit" ) .
EmptyCommit ( "fixup! branch commit" )
} ,
Run : func ( t * TestDriver , keys config . KeybindingConfig ) {
t . Views ( ) . Commits ( ) .
Lines (
Contains ( "fixup! branch commit" ) ,
Contains ( "branch commit" ) ,
Contains ( "base" ) ,
)
t . Views ( ) . Branches ( ) .
Focus ( ) .
Lines (
Contains ( "my-branch" ) . IsSelected ( ) ,
Contains ( "master" ) ,
) .
SelectNextItem ( ) .
Press ( keys . Branches . RebaseBranch )
2023-03-29 15:45:06 +02:00
t . ExpectPopup ( ) . Menu ( ) .
Title ( Equals ( "Rebase 'my-branch' onto 'master'" ) ) .
2023-05-25 13:11:51 +02:00
Select ( Contains ( "Simple rebase" ) ) .
2023-02-09 18:29:09 +02:00
Confirm ( )
t . Views ( ) . Commits ( ) . Lines (
Contains ( "fixup! branch commit" ) ,
Contains ( "branch commit" ) ,
Contains ( "master commit" ) ,
Contains ( "base" ) ,
)
} ,
} )