Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Checkout = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Checkout a reflog commit as a detached head", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("one") shell.EmptyCommit("two") shell.EmptyCommit("three") shell.HardReset("HEAD^^") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().ReflogCommits(). Focus(). Lines( Contains("reset: moving to HEAD^^").IsSelected(), Contains("commit: three"), Contains("commit: two"), Contains("commit (initial): one"), ). SelectNextItem(). PressPrimaryAction(). Tap(func() { t.ExpectPopup().Menu(). Title(Contains("Checkout branch or commit")). Select(MatchesRegexp("Checkout commit [a-f0-9]+ as detached head")). Confirm() }). TopLines( Contains("checkout: moving from master to").IsSelected(), Contains("reset: moving to HEAD^^"), ) t.Views().Branches(). Lines( Contains("(HEAD detached at").IsSelected(), Contains("master"), ) t.Views().Commits(). Focus(). Lines( Contains("three").IsSelected(), Contains("two"), Contains("one"), ) }, })
View Source
var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Cherry pick a reflog commit", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("one") shell.EmptyCommit("two") shell.EmptyCommit("three") shell.HardReset("HEAD^^") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().ReflogCommits(). Focus(). Lines( Contains("reset: moving to HEAD^^").IsSelected(), Contains("commit: three"), Contains("commit: two"), Contains("commit (initial): one"), ). SelectNextItem(). Press(keys.Commits.CherryPickCopy) t.Views().Information().Content(Contains("1 commit copied")) t.Views().Commits(). Focus(). Lines( Contains("one").IsSelected(), ). Press(keys.Commits.PasteCommits). Tap(func() { t.ExpectPopup().Alert(). Title(Equals("Cherry-pick")). Content(Contains("Are you sure you want to cherry-pick the 1 copied commit(s) onto this branch?")). Confirm() }). Lines( Contains("three").IsSelected(), Contains("one"), ) }, })
View Source
var DoNotShowBranchMarkersInReflogSubcommits = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Verify that no branch heads are shown in the subcommits view of a reflog entry", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) { config.GetAppState().GitLogShowGraph = "never" }, SetupRepo: func(shell *Shell) { shell.NewBranch("branch1") shell.EmptyCommit("one") shell.EmptyCommit("two") shell.NewBranch("branch2") shell.EmptyCommit("three") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). Lines( Contains("CI three"), Contains("CI * two"), Contains("CI one"), ) t.Views().Branches(). Focus(). NavigateToLine(Contains("branch1")). PressPrimaryAction(). NavigateToLine(Contains("branch2")). PressEnter(). Tap(func() { t.Views().SubCommits(). IsFocused(). Lines( Contains("CI three"), Contains("CI * two"), Contains("CI one"), ). PressEscape() }). NavigateToLine(Contains("branch2")). PressPrimaryAction() t.Views().ReflogCommits(). Focus(). TopLines( Contains("checkout: moving from branch1 to branch2").IsSelected(), ). PressEnter(). Tap(func() { t.Views().SubCommits(). IsFocused(). Lines( Contains("CI three"), Contains("CI two"), Contains("CI one"), ) }) }, })
View Source
var Patch = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Build a patch from a reflog commit and apply it", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("one") shell.EmptyCommit("two") shell.CreateFileAndAdd("file1", "content1") shell.CreateFileAndAdd("file2", "content2") shell.Commit("three") shell.HardReset("HEAD^^") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().ReflogCommits(). Focus(). Lines( Contains("reset: moving to HEAD^^").IsSelected(), Contains("commit: three"), Contains("commit: two"), Contains("commit (initial): one"), ). SelectNextItem(). Lines( Contains("reset: moving to HEAD^^"), Contains("commit: three").IsSelected(), Contains("commit: two"), Contains("commit (initial): one"), ). PressEnter() t.Views().SubCommits(). IsFocused(). Lines( Contains("three").IsSelected(), Contains("two"), Contains("one"), ). PressEnter() t.Views().CommitFiles(). IsFocused(). Lines( Equals("▼ /").IsSelected(), Contains("file1"), Contains("file2"), ). SelectNextItem(). PressPrimaryAction() t.Views().Information().Content(Contains("Building patch")) t.Views(). CommitFiles(). Press(keys.Universal.CreatePatchOptionsMenu) t.ExpectPopup().Menu(). Title(Equals("Patch options")). Select(MatchesRegexp(`Apply patch$`)).Confirm() t.Views().Files().Lines( Contains("file1"), ) }, })
View Source
var Reset = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Hard reset to a reflog commit", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("one") shell.EmptyCommit("two") shell.EmptyCommit("three") shell.HardReset("HEAD^^") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().ReflogCommits(). Focus(). Lines( Contains("reset: moving to HEAD^^").IsSelected(), Contains("commit: three"), Contains("commit: two"), Contains("commit (initial): one"), ). SelectNextItem(). Press(keys.Commits.ViewResetOptions). Tap(func() { t.ExpectPopup().Menu(). Title(Contains("Reset to")). Select(Contains("Hard reset")). Confirm() }). TopLines( Contains("reset: moving to").IsSelected(), Contains("reset: moving to HEAD^^"), ) t.Views().Commits(). Focus(). Lines( Contains("three").IsSelected(), Contains("two"), Contains("one"), ) }, })
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.