Use getters for AppState and UserConfig instead of accessing the fields directly

This will allow us to make them private.
This commit is contained in:
Stefan Haller 2024-07-14 14:22:36 +02:00
parent 54765d2236
commit 55d8e801f1
63 changed files with 76 additions and 76 deletions

View file

@ -15,7 +15,7 @@ var Basic = NewIntegrationTest(NewIntegrationTestArgs{
CreateNCommits(10)
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.AppState.GitLogShowGraph = "never"
cfg.GetAppState().GitLogShowGraph = "never"
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
markCommitAsBad := func() {

View file

@ -15,7 +15,7 @@ var ChooseTerms = NewIntegrationTest(NewIntegrationTestArgs{
CreateNCommits(10)
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.AppState.GitLogShowGraph = "never"
cfg.GetAppState().GitLogShowGraph = "never"
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
markCommitAsFixed := func() {

View file

@ -14,7 +14,7 @@ var Skip = NewIntegrationTest(NewIntegrationTestArgs{
CreateNCommits(10)
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.AppState.GitLogShowGraph = "never"
cfg.GetAppState().GitLogShowGraph = "never"
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Commits().

View file

@ -11,7 +11,7 @@ var RebaseCopiedBranch = NewIntegrationTest(NewIntegrationTestArgs{
Skip: false,
GitVersion: AtLeast("2.38.0"),
SetupConfig: func(config *config.AppConfig) {
config.AppState.GitLogShowGraph = "never"
config.GetAppState().GitLogShowGraph = "never"
},
SetupRepo: func(shell *Shell) {
shell.

View file

@ -10,7 +10,7 @@ var RebaseOntoBaseBranch = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.Gui.ShowDivergenceFromBaseBranch = "arrowAndNumber"
config.GetUserConfig().Gui.ShowDivergenceFromBaseBranch = "arrowAndNumber"
},
SetupRepo: func(shell *Shell) {
shell.

View file

@ -10,7 +10,7 @@ var ShowDivergenceFromBaseBranch = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.Gui.ShowDivergenceFromBaseBranch = "arrowAndNumber"
config.GetUserConfig().Gui.ShowDivergenceFromBaseBranch = "arrowAndNumber"
},
SetupRepo: func(shell *Shell) {
shell.

View file

@ -10,7 +10,7 @@ var CherryPickDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.AppState.GitLogShowGraph = "never"
config.GetAppState().GitLogShowGraph = "never"
},
SetupRepo: func(shell *Shell) {
shell.

View file

@ -11,7 +11,7 @@ var AutoWrapMessage = NewIntegrationTest(NewIntegrationTestArgs{
Skip: false,
SetupConfig: func(config *config.AppConfig) {
// Use a ridiculously small width so that we don't have to use so much test data
config.UserConfig.Git.Commit.AutoWrapWidth = 20
config.GetUserConfig().Git.Commit.AutoWrapWidth = 20
},
SetupRepo: func(shell *Shell) {
shell.CreateFile("file", "file content")

View file

@ -9,8 +9,8 @@ var CommitWipWithPrefix = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Commit with skip hook and config commitPrefix is defined. Prefix is ignored when creating WIP commits.",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(testConfig *config.AppConfig) {
testConfig.UserConfig.Git.CommitPrefixes = map[string]config.CommitPrefixConfig{"repo": {Pattern: "^\\w+\\/(\\w+-\\w+).*", Replace: "[$1]: "}}
SetupConfig: func(cfg *config.AppConfig) {
cfg.GetUserConfig().Git.CommitPrefixes = map[string]config.CommitPrefixConfig{"repo": {Pattern: "^\\w+\\/(\\w+-\\w+).*", Replace: "[$1]: "}}
},
SetupRepo: func(shell *Shell) {
shell.NewBranch("feature/TEST-002")

View file

@ -9,8 +9,8 @@ var CommitWithGlobalPrefix = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Commit with defined config commitPrefix",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(testConfig *config.AppConfig) {
testConfig.UserConfig.Git.CommitPrefix = &config.CommitPrefixConfig{Pattern: "^\\w+\\/(\\w+-\\w+).*", Replace: "[$1]: "}
SetupConfig: func(cfg *config.AppConfig) {
cfg.GetUserConfig().Git.CommitPrefix = &config.CommitPrefixConfig{Pattern: "^\\w+\\/(\\w+-\\w+).*", Replace: "[$1]: "}
},
SetupRepo: func(shell *Shell) {
shell.NewBranch("feature/TEST-001")

View file

@ -9,8 +9,8 @@ var CommitWithNonMatchingBranchName = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Commit with defined config commitPrefixes",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(testConfig *config.AppConfig) {
testConfig.UserConfig.Git.CommitPrefix = &config.CommitPrefixConfig{
SetupConfig: func(cfg *config.AppConfig) {
cfg.GetUserConfig().Git.CommitPrefix = &config.CommitPrefixConfig{
Pattern: "^\\w+\\/(\\w+-\\w+).*",
Replace: "[$1]: ",
}

View file

@ -9,8 +9,8 @@ var CommitWithPrefix = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Commit with defined config commitPrefixes",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(testConfig *config.AppConfig) {
testConfig.UserConfig.Git.CommitPrefixes = map[string]config.CommitPrefixConfig{"repo": {Pattern: "^\\w+\\/(\\w+-\\w+).*", Replace: "[$1]: "}}
SetupConfig: func(cfg *config.AppConfig) {
cfg.GetUserConfig().Git.CommitPrefixes = map[string]config.CommitPrefixConfig{"repo": {Pattern: "^\\w+\\/(\\w+-\\w+).*", Replace: "[$1]: "}}
},
SetupRepo: func(shell *Shell) {
shell.NewBranch("feature/TEST-001")

View file

@ -10,7 +10,7 @@ var Highlight = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.AppState.GitLogShowGraph = "always"
config.GetAppState().GitLogShowGraph = "always"
config.GetUserConfig().Gui.AuthorColors = map[string]string{
"CI": "red",
}

View file

@ -10,7 +10,7 @@ var NewBranchWithPrefix = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.Git.BranchPrefix = "myprefix/"
cfg.GetUserConfig().Git.BranchPrefix = "myprefix/"
},
SetupRepo: func(shell *Shell) {
shell.

View file

@ -10,8 +10,8 @@ var PasteCommitMessage = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.OS.CopyToClipboardCmd = "echo {{text}} > ../clipboard"
config.UserConfig.OS.ReadFromClipboardCmd = "cat ../clipboard"
config.GetUserConfig().OS.CopyToClipboardCmd = "echo {{text}} > ../clipboard"
config.GetUserConfig().OS.ReadFromClipboardCmd = "cat ../clipboard"
},
SetupRepo: func(shell *Shell) {
shell.EmptyCommit("subject\n\nbody 1st line\nbody 2nd line")

View file

@ -10,8 +10,8 @@ var PasteCommitMessageOverExisting = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.OS.CopyToClipboardCmd = "echo {{text}} > ../clipboard"
config.UserConfig.OS.ReadFromClipboardCmd = "cat ../clipboard"
config.GetUserConfig().OS.CopyToClipboardCmd = "echo {{text}} > ../clipboard"
config.GetUserConfig().OS.ReadFromClipboardCmd = "cat ../clipboard"
},
SetupRepo: func(shell *Shell) {
shell.EmptyCommit("subject\n\nbody 1st line\nbody 2nd line")

View file

@ -15,7 +15,7 @@ var AccessCommitProperties = NewIntegrationTest(NewIntegrationTestArgs{
shell.EmptyCommit("my change")
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "X",
Context: "commits",

View file

@ -13,7 +13,7 @@ var BasicCommand = NewIntegrationTest(NewIntegrationTestArgs{
shell.EmptyCommit("blah")
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "a",
Context: "files",

View file

@ -14,7 +14,7 @@ var CheckForConflicts = NewIntegrationTest(NewIntegrationTestArgs{
shared.MergeConflictsSetup(shell)
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "m",
Context: "localBranches",

View file

@ -13,7 +13,7 @@ var FormPrompts = NewIntegrationTest(NewIntegrationTestArgs{
shell.EmptyCommit("blah")
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "a",
Context: "files",

View file

@ -13,7 +13,7 @@ var GlobalContext = NewIntegrationTest(NewIntegrationTestArgs{
shell.EmptyCommit("my change")
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "X",
Context: "global",

View file

@ -19,7 +19,7 @@ var MenuFromCommand = NewIntegrationTest(NewIntegrationTestArgs{
NewBranch("feature/foo")
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "a",
Context: "localBranches",

View file

@ -18,7 +18,7 @@ var MenuFromCommandsOutput = NewIntegrationTest(NewIntegrationTestArgs{
EmptyCommit("baz")
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "a",
Context: "localBranches",

View file

@ -13,7 +13,7 @@ var MultipleContexts = NewIntegrationTest(NewIntegrationTestArgs{
shell.EmptyCommit("my change")
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "X",
Context: "commits, reflogCommits",

View file

@ -13,7 +13,7 @@ var MultiplePrompts = NewIntegrationTest(NewIntegrationTestArgs{
shell.EmptyCommit("blah")
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "a",
Context: "files",

View file

@ -13,7 +13,7 @@ var SelectedCommit = NewIntegrationTest(NewIntegrationTestArgs{
shell.CreateNCommits(3)
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "X",
Context: "global",

View file

@ -17,7 +17,7 @@ var SelectedPath = NewIntegrationTest(NewIntegrationTestArgs{
shell.CreateFile("folder2/file2", "")
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "X",
Context: "global",

View file

@ -15,7 +15,7 @@ var ShowOutputInPanel = NewIntegrationTest(NewIntegrationTestArgs{
shell.EmptyCommit("my change")
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "X",
Context: "commits",

View file

@ -20,7 +20,7 @@ var SuggestionsCommand = NewIntegrationTest(NewIntegrationTestArgs{
shell.EmptyCommit("blah")
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "a",
Context: "localBranches",

View file

@ -20,7 +20,7 @@ var SuggestionsPreset = NewIntegrationTest(NewIntegrationTestArgs{
shell.EmptyCommit("blah")
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "a",
Context: "localBranches",

View file

@ -12,7 +12,7 @@ var AmendOldCommit = NewIntegrationTest(NewIntegrationTestArgs{
IsDemo: true,
SetupConfig: func(config *config.AppConfig) {
setDefaultDemoConfig(config)
config.UserConfig.Gui.ShowFileTree = false
config.GetUserConfig().Gui.ShowFileTree = false
},
SetupRepo: func(shell *Shell) {
shell.CreateNCommitsWithRandomMessages(60)

View file

@ -26,7 +26,7 @@ var CustomCommand = NewIntegrationTest(NewIntegrationTestArgs{
SetupConfig: func(cfg *config.AppConfig) {
setDefaultDemoConfig(cfg)
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "a",
Context: "localBranches",

View file

@ -13,8 +13,8 @@ var DiffCommits = NewIntegrationTest(NewIntegrationTestArgs{
SetupConfig: func(config *config.AppConfig) {
setDefaultDemoConfig(config)
config.UserConfig.Gui.ShowFileTree = false
config.UserConfig.Gui.ShowCommandLog = false
config.GetUserConfig().Gui.ShowFileTree = false
config.GetUserConfig().Gui.ShowCommandLog = false
},
SetupRepo: func(shell *Shell) {
shell.CreateNCommitsWithRandomMessages(50)

View file

@ -12,7 +12,7 @@ var NukeWorkingTree = NewIntegrationTest(NewIntegrationTestArgs{
IsDemo: true,
SetupConfig: func(config *config.AppConfig) {
setDefaultDemoConfig(config)
config.UserConfig.Gui.AnimateExplosion = true
config.GetUserConfig().Gui.AnimateExplosion = true
},
SetupRepo: func(shell *Shell) {
shell.EmptyCommit("blah")

View file

@ -4,7 +4,7 @@ import "github.com/jesseduffield/lazygit/pkg/config"
// Gives us nicer colours when we generate a git repo history with `shell.CreateRepoHistory()`
func setGeneratedAuthorColours(config *config.AppConfig) {
config.UserConfig.Gui.AuthorColors = map[string]string{
config.GetUserConfig().Gui.AuthorColors = map[string]string{
"Fredrica Greenhill": "#fb5aa3",
"Oscar Reuenthal": "#86c82f",
"Paul Oberstein": "#ffd500",
@ -15,5 +15,5 @@ func setGeneratedAuthorColours(config *config.AppConfig) {
func setDefaultDemoConfig(config *config.AppConfig) {
// demos look much nicers with icons shown
config.UserConfig.Gui.NerdFontsVersion = "3"
config.GetUserConfig().Gui.NerdFontsVersion = "3"
}

View file

@ -40,8 +40,8 @@ var StageLines = NewIntegrationTest(NewIntegrationTestArgs{
IsDemo: true,
SetupConfig: func(config *config.AppConfig) {
setDefaultDemoConfig(config)
config.UserConfig.Gui.ShowFileTree = false
config.UserConfig.Gui.ShowCommandLog = false
config.GetUserConfig().Gui.ShowFileTree = false
config.GetUserConfig().Gui.ShowCommandLog = false
},
SetupRepo: func(shell *Shell) {
shell.NewBranch("docs-fix")

View file

@ -17,7 +17,7 @@ var CopyMenu = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.OS.CopyToClipboardCmd = "echo {{text}} > clipboard"
config.GetUserConfig().OS.CopyToClipboardCmd = "echo {{text}} > clipboard"
},
SetupRepo: func(shell *Shell) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {

View file

@ -10,7 +10,7 @@ var FilterFuzzy = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.Gui.FilterMode = "fuzzy"
config.GetUserConfig().Gui.FilterMode = "fuzzy"
},
SetupRepo: func(shell *Shell) {
shell.NewBranch("this-is-my-branch")

View file

@ -10,7 +10,7 @@ var FilterMenuWithNoKeybindings = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.Keybinding.Universal.ToggleWhitespaceInDiffView = "<disabled>"
config.GetUserConfig().Keybinding.Universal.ToggleWhitespaceInDiffView = "<disabled>"
},
SetupRepo: func(shell *Shell) {
},

View file

@ -10,7 +10,7 @@ var SelectAuthor = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.AppState.GitLogShowGraph = "never"
config.GetAppState().GitLogShowGraph = "never"
},
SetupRepo: func(shell *Shell) {
commonSetup(shell)

View file

@ -11,7 +11,7 @@ var DontShowBranchHeadsForTodoItems = NewIntegrationTest(NewIntegrationTestArgs{
Skip: false,
GitVersion: AtLeast("2.38.0"),
SetupConfig: func(config *config.AppConfig) {
config.AppState.GitLogShowGraph = "never"
config.GetAppState().GitLogShowGraph = "never"
},
SetupRepo: func(shell *Shell) {
shell.

View file

@ -11,7 +11,7 @@ var DropCommitInCopiedBranchWithUpdateRef = NewIntegrationTest(NewIntegrationTes
Skip: false,
GitVersion: AtLeast("2.38.0"),
SetupConfig: func(config *config.AppConfig) {
config.AppState.GitLogShowGraph = "never"
config.GetAppState().GitLogShowGraph = "never"
},
SetupRepo: func(shell *Shell) {
shell.

View file

@ -12,7 +12,7 @@ var DropTodoCommitWithUpdateRef = NewIntegrationTest(NewIntegrationTestArgs{
GitVersion: AtLeast("2.38.0"),
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().Git.MainBranches = []string{"master"}
config.AppState.GitLogShowGraph = "never"
config.GetAppState().GitLogShowGraph = "never"
},
SetupRepo: func(shell *Shell) {
shell.

View file

@ -11,7 +11,7 @@ var InteractiveRebaseOfCopiedBranch = NewIntegrationTest(NewIntegrationTestArgs{
Skip: false,
GitVersion: AtLeast("2.38.0"),
SetupConfig: func(config *config.AppConfig) {
config.AppState.GitLogShowGraph = "never"
config.GetAppState().GitLogShowGraph = "never"
},
SetupRepo: func(shell *Shell) {
shell.

View file

@ -12,7 +12,7 @@ var QuickStartKeepSelection = NewIntegrationTest(NewIntegrationTestArgs{
GitVersion: AtLeast("2.38.0"),
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().Git.MainBranches = []string{"master"}
config.AppState.GitLogShowGraph = "never"
config.GetAppState().GitLogShowGraph = "never"
},
SetupRepo: func(shell *Shell) {
shell.

View file

@ -12,7 +12,7 @@ var QuickStartKeepSelectionRange = NewIntegrationTest(NewIntegrationTestArgs{
GitVersion: AtLeast("2.38.0"),
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().Git.MainBranches = []string{"master"}
config.AppState.GitLogShowGraph = "never"
config.GetAppState().GitLogShowGraph = "never"
},
SetupRepo: func(shell *Shell) {
shell.

View file

@ -10,7 +10,7 @@ var ShowExecTodos = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "X",
Context: "commits",

View file

@ -11,7 +11,7 @@ var ViewFilesOfTodoEntries = NewIntegrationTest(NewIntegrationTestArgs{
Skip: false,
GitVersion: AtLeast("2.38.0"),
SetupConfig: func(config *config.AppConfig) {
config.AppState.GitLogShowGraph = "never"
config.GetAppState().GitLogShowGraph = "never"
},
SetupRepo: func(shell *Shell) {
shell.

View file

@ -10,7 +10,7 @@ var ConfirmOnQuit = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.ConfirmOnQuit = true
config.GetUserConfig().ConfirmOnQuit = true
},
SetupRepo: func(shell *Shell) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {

View file

@ -12,7 +12,7 @@ var CopyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.OS.CopyToClipboardCmd = "echo {{text}} > clipboard"
config.GetUserConfig().OS.CopyToClipboardCmd = "echo {{text}} > clipboard"
},
SetupRepo: func(shell *Shell) {

View file

@ -10,10 +10,10 @@ var DisabledKeybindings = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.Keybinding.Universal.PrevItem = "<disabled>"
config.UserConfig.Keybinding.Universal.NextItem = "<disabled>"
config.UserConfig.Keybinding.Universal.NextTab = "<up>"
config.UserConfig.Keybinding.Universal.PrevTab = "<down>"
config.GetUserConfig().Keybinding.Universal.PrevItem = "<disabled>"
config.GetUserConfig().Keybinding.Universal.NextItem = "<disabled>"
config.GetUserConfig().Keybinding.Universal.NextTab = "<up>"
config.GetUserConfig().Keybinding.Universal.PrevTab = "<down>"
},
SetupRepo: func(shell *Shell) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {

View file

@ -10,7 +10,7 @@ var InitialOpen = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.DisableStartupPopups = false
config.GetUserConfig().DisableStartupPopups = false
},
SetupRepo: func(shell *Shell) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {

View file

@ -10,7 +10,7 @@ var DoNotShowBranchMarkersInReflogSubcommits = NewIntegrationTest(NewIntegration
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.AppState.GitLogShowGraph = "never"
config.GetAppState().GitLogShowGraph = "never"
},
SetupRepo: func(shell *Shell) {
shell.NewBranch("branch1")

View file

@ -10,8 +10,8 @@ var LogCmd = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.Git.AllBranchesLogCmd = `echo "view1"`
config.UserConfig.Git.AllBranchesLogCmds = []string{`echo "view2"`}
config.GetUserConfig().Git.AllBranchesLogCmd = `echo "view1"`
config.GetUserConfig().Git.AllBranchesLogCmds = []string{`echo "view2"`}
},
SetupRepo: func(shell *Shell) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {

View file

@ -10,7 +10,7 @@ var ShowDivergenceFromBaseBranch = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.Gui.ShowDivergenceFromBaseBranch = "arrowAndNumber"
config.GetUserConfig().Gui.ShowDivergenceFromBaseBranch = "arrowAndNumber"
},
SetupRepo: func(shell *Shell) {
shell.CreateNCommits(2)

View file

@ -10,7 +10,7 @@ var Enter = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "e",
Context: "files",

View file

@ -10,7 +10,7 @@ var Reset = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "e",
Context: "files",

View file

@ -13,7 +13,7 @@ var KeybindingSuggestionsWhenSwitchingRepos = NewIntegrationTest(NewIntegrationT
Skip: false,
SetupConfig: func(config *config.AppConfig) {
otherRepo, _ := filepath.Abs("../other")
config.AppState.RecentRepos = []string{otherRepo}
config.GetAppState().RecentRepos = []string{otherRepo}
},
SetupRepo: func(shell *Shell) {
shell.CloneNonBare("other")

View file

@ -10,7 +10,7 @@ var OpenLinkFailure = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.OS.OpenLink = "exit 42"
config.GetUserConfig().OS.OpenLink = "exit 42"
},
SetupRepo: func(shell *Shell) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {

View file

@ -15,7 +15,7 @@ var BareRepoWorktreeConfig = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{"--git-dir={{.actualPath}}/.bare"},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.Gui.ShowFileTree = false
config.GetUserConfig().Gui.ShowFileTree = false
},
SetupRepo: func(shell *Shell) {
// we're going to have a directory structure like this:

View file

@ -10,7 +10,7 @@ var CustomCommand = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(cfg *config.AppConfig) {
cfg.UserConfig.CustomCommands = []config.CustomCommand{
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "d",
Context: "worktrees",

View file

@ -13,7 +13,7 @@ var DoubleNestedLinkedSubmodule = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.Gui.ShowFileTree = false
config.GetUserConfig().Gui.ShowFileTree = false
},
SetupRepo: func(shell *Shell) {
// we're going to have a directory structure like this:

View file

@ -10,7 +10,7 @@ var SymlinkIntoRepoSubdir = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.Gui.ShowFileTree = false
config.GetUserConfig().Gui.ShowFileTree = false
},
SetupRepo: func(shell *Shell) {
// we're going to have a directory structure like this: