Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CustomCommandsInPerRepoConfig = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Custom commands in per-repo config add to the global ones instead of replacing them", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(cfg *config.AppConfig) { otherRepo, _ := filepath.Abs("../other") _ = cfg.UpdateAppState(func(state *config.AppState) { state.RecentRepos = []string{otherRepo} }) cfg.GetUserConfig().CustomCommands = []config.CustomCommand{ { Key: config.Keybinding{"X"}, Context: "global", Command: "printf 'global X' > file.txt", }, { Key: config.Keybinding{"Y"}, Context: "global", Command: "printf 'global Y' > file.txt", }, } }, SetupRepo: func(shell *Shell) { shell.CloneNonBare("other") shell.CreateFile("../other/.git/lazygit.yml", ` customCommands: - key: Y context: global command: printf 'local Y' > file.txt - key: Z context: global command: printf 'local Z' > file.txt`) }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.GlobalPress(keys.Universal.OpenRecentRepos) t.ExpectPopup().Menu().Title(Equals("Recent repositories")). Lines( Contains("other").IsSelected(), Contains("Cancel"), ).Confirm() t.Views().Status().Content(Contains("other → master")) t.GlobalPress(config.Keybinding{"X"}) t.FileSystem().FileContent("../other/file.txt", Equals("global X")) t.GlobalPress(config.Keybinding{"Y"}) t.FileSystem().FileContent("../other/file.txt", Equals("local Y")) t.GlobalPress(config.Keybinding{"Z"}) t.FileSystem().FileContent("../other/file.txt", Equals("local Z")) }, })
View Source
var IgnoreTrackedConfigInParentDir = NewIntegrationTest(NewIntegrationTestArgs{ Description: "When entering a submodule, a .lazygit.yml in a parent directory is ignored if the superproject tracks it", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(cfg *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("first commit") shell.CloneIntoSubmodule("sub", "modules/sub") shell.Commit("add submodule") shell.CreateFileAndAdd(".lazygit.yml", ` customCommands: - key: X context: global command: "true" description: Command from a tracked config in a parent dir`) shell.Commit("add config") shell.CreateFile("modules/.lazygit.yml", ` customCommands: - key: Y context: global command: "true" description: Command from an untracked config in a parent dir`) }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Submodules().Focus(). Lines( Contains("sub").IsSelected(), ). PressEnter() t.Views().Status().Content(Contains("sub")) t.ExpectToast(MatchesRegexp(`^Ignored config tracked by git: .*repo.\.lazygit\.yml$`)) t.Views().Files().IsFocused(). Press(keys.Universal.OptionMenu) t.ExpectPopup().Menu(). Title(Equals("Keybindings")). Filter("in a parent dir"). Lines( Contains("─── Global"), Contains("Command from an untracked config in a parent dir").IsSelected(), ) }, })
View Source
var IgnoreTrackedConfigInParentDirOnReload = NewIntegrationTest(NewIntegrationTestArgs{ Description: "While lazygit is in a submodule, checking out a branch of the superproject that tracks a .lazygit.yml doesn't load that file on the next config reload", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(cfg *config.AppConfig) {}, SetupRepo: func(shell *Shell) { shell.EmptyCommit("first commit") shell.CloneIntoSubmodule("sub", "modules/sub") shell.Commit("add submodule") shell.NewBranch("other-branch") shell.CreateFileAndAdd(".lazygit.yml", ` customCommands: - key: X context: global command: "true" description: Command from a tracked config in a parent dir`) shell.Commit("add config") shell.Checkout("master") shell.CreateFile("modules/.lazygit.yml", ` customCommands: - key: Y context: global command: "true" description: Command from an untracked config in a parent dir`) }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Submodules().Focus(). Lines( Contains("sub").IsSelected(), ). PressEnter() t.Views().Status().Content(Contains("sub")) t.Shell().Checkout("other-branch") t.FocusIn() t.ExpectToast(MatchesRegexp(`^Ignored config tracked by git: .*repo.\.lazygit\.yml$`)) t.Views().Files().IsFocused(). Press(keys.Universal.OptionMenu) t.ExpectPopup().Menu(). Title(Equals("Keybindings")). Filter("in a parent dir"). Lines( Contains("─── Global"), Contains("Command from an untracked config in a parent dir").IsSelected(), ) }, })
View Source
var NegativeRefspec = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Having a config with a negative refspec", ExtraCmdArgs: []string{}, SetupRepo: func(shell *Shell) { shell. SetConfig("remote.origin.fetch", "^refs/heads/test"). CreateNCommits(2) }, SetupConfig: func(cfg *config.AppConfig) {}, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Branches(). Lines( Contains("master"), ) }, })
View Source
var RemoteNamedStar = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Having a config remote.*", ExtraCmdArgs: []string{}, Skip: false, SetupRepo: func(shell *Shell) { shell. SetConfig("remote.*.prune", "true"). CreateNCommits(2) }, SetupConfig: func(cfg *config.AppConfig) {}, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.Views().Commits(). Lines( AnyString(), AnyString(), ) }, })
View Source
var SidePanelsInPerRepoConfig = NewIntegrationTest(NewIntegrationTestArgs{ Description: "A per-repo config can set the side panel layout, and switching repos re-applies each repo's own layout", ExtraCmdArgs: []string{}, Skip: false, SetupConfig: func(cfg *config.AppConfig) { otherRepo, _ := filepath.Abs("../other") _ = cfg.UpdateAppState(func(state *config.AppState) { state.RecentRepos = []string{otherRepo} }) }, SetupRepo: func(shell *Shell) { shell.CloneNonBare("other") shell.CreateFile("../other/.git/lazygit.yml", ` gui: sidePanels: - [status] - [files, worktrees, submodules] - [commits, reflog] - [branches, remotes, tags] - [stash]`) }, Run: func(t *TestDriver, keys config.KeybindingConfig) { t.GlobalPress(keys.Universal.JumpToBlock[2]) t.Views().Branches().IsFocused() t.GlobalPress(keys.Universal.OpenRecentRepos) t.ExpectPopup().Menu().Title(Equals("Recent repositories")). Lines( Contains("other").IsSelected(), Contains("Cancel"), ).Confirm() t.Views().Status().Content(Contains("other → master")) t.GlobalPress(keys.Universal.JumpToBlock[2]) t.Views().Commits().IsFocused() t.GlobalPress(keys.Universal.JumpToBlock[1]) t.Views().Files().IsFocused() t.GlobalPress(keys.Universal.OpenRecentRepos) t.ExpectPopup().Menu().Title(Equals("Recent repositories")).Confirm() t.GlobalPress(keys.Universal.JumpToBlock[2]) t.Views().Branches().IsFocused() }, })
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.