mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-10 11:10:18 +02:00
d772c9f1d4
We have not been good at consistent casing so far. Now we use 'Sentence case' everywhere. EVERYWHERE. Also Removing 'Lc' prefix from i18n field names: the 'Lc' stood for lowercase but now that everything is in 'Sentence case' there's no need for the distinction. I've got a couple lower case things I've kept: namely, things that show up in parentheses.
56 lines
1.4 KiB
Go
56 lines
1.4 KiB
Go
package sync
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
var RenameBranchAndPull = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "Rename a branch to no longer match its upstream, then pull from the upstream",
|
|
ExtraCmdArgs: []string{},
|
|
Skip: false,
|
|
SetupConfig: func(config *config.AppConfig) {},
|
|
SetupRepo: func(shell *Shell) {
|
|
shell.EmptyCommit("one")
|
|
shell.EmptyCommit("two")
|
|
|
|
shell.CloneIntoRemote("origin")
|
|
shell.SetBranchUpstream("master", "origin/master")
|
|
|
|
// remove the 'two' commit so that we have something to pull from the remote
|
|
shell.HardReset("HEAD^")
|
|
},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.Views().Commits().
|
|
Lines(
|
|
Contains("one"),
|
|
)
|
|
|
|
t.Views().Branches().
|
|
Focus().
|
|
Lines(
|
|
Contains("master"),
|
|
).
|
|
Press(keys.Branches.RenameBranch).
|
|
Tap(func() {
|
|
t.ExpectPopup().Confirmation().
|
|
Title(Equals("Rename branch")).
|
|
Content(Equals("This branch is tracking a remote. This action will only rename the local branch name, not the name of the remote branch. Continue?")).
|
|
Confirm()
|
|
|
|
t.ExpectPopup().Prompt().
|
|
Title(Contains("Enter new branch name")).
|
|
InitialText(Equals("master")).
|
|
Type("-local").
|
|
Confirm()
|
|
}).
|
|
Press(keys.Universal.Pull)
|
|
|
|
t.Views().Commits().
|
|
Lines(
|
|
Contains("two"),
|
|
Contains("one"),
|
|
)
|
|
},
|
|
})
|