mirror of
				https://github.com/jesseduffield/lazygit.git
				synced 2025-10-30 23:57:43 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			50 lines
		
	
	
		
			961 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			961 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package sync
 | |
| 
 | |
| import (
 | |
| 	. "github.com/jesseduffield/lazygit/pkg/integration/components"
 | |
| )
 | |
| 
 | |
| func createTwoBranchesReadyToForcePush(shell *Shell) {
 | |
| 	shell.EmptyCommit("one")
 | |
| 	shell.EmptyCommit("two")
 | |
| 
 | |
| 	shell.NewBranch("other_branch")
 | |
| 
 | |
| 	shell.CloneIntoRemote("origin")
 | |
| 
 | |
| 	shell.SetBranchUpstream("master", "origin/master")
 | |
| 	shell.SetBranchUpstream("other_branch", "origin/other_branch")
 | |
| 
 | |
| 	// remove the 'two' commit so that we have something to pull from the remote
 | |
| 	shell.HardReset("HEAD^")
 | |
| 
 | |
| 	shell.Checkout("master")
 | |
| 	// doing the same for master
 | |
| 	shell.HardReset("HEAD^")
 | |
| }
 | |
| 
 | |
| func assertSuccessfullyPushed(t *TestDriver) {
 | |
| 	t.Views().Status().Content(Contains("✓ repo → master"))
 | |
| 
 | |
| 	t.Views().Remotes().
 | |
| 		Focus().
 | |
| 		Lines(
 | |
| 			Contains("origin"),
 | |
| 		).
 | |
| 		PressEnter()
 | |
| 
 | |
| 	t.Views().RemoteBranches().
 | |
| 		IsFocused().
 | |
| 		Lines(
 | |
| 			Contains("master"),
 | |
| 		).
 | |
| 		PressEnter()
 | |
| 
 | |
| 	t.Views().SubCommits().
 | |
| 		IsFocused().
 | |
| 		Lines(
 | |
| 			Contains("two"),
 | |
| 			Contains("one"),
 | |
| 		)
 | |
| }
 |