diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2023-08-28 12:39:52 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2023-09-04 17:50:49 +0200 |
commit | 1dac4158e9d8c8ab60203c76e9f86af409724823 (patch) | |
tree | 8f3a2175b6c42ba544a74e1e5f4bb91e7d7afce7 /pkg/commands/git_commands/working_tree_test.go | |
parent | 18c57804854692bd84ac50e88a10da7d81df363d (diff) |
Don't pass ignoreWhitespace to git commands
Now that AppState is available via common.Common, they can take it from there.
Diffstat (limited to 'pkg/commands/git_commands/working_tree_test.go')
-rw-r--r-- | pkg/commands/git_commands/working_tree_test.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/pkg/commands/git_commands/working_tree_test.go b/pkg/commands/git_commands/working_tree_test.go index a79631236..8137a96af 100644 --- a/pkg/commands/git_commands/working_tree_test.go +++ b/pkg/commands/git_commands/working_tree_test.go @@ -310,9 +310,11 @@ func TestWorkingTreeDiff(t *testing.T) { t.Run(s.testName, func(t *testing.T) { userConfig := config.GetDefaultConfig() userConfig.Git.DiffContextSize = s.contextSize + appState := &config.AppState{} + appState.IgnoreWhitespaceInDiffView = s.ignoreWhitespace - instance := buildWorkingTreeCommands(commonDeps{runner: s.runner, userConfig: userConfig}) - result := instance.WorktreeFileDiff(s.file, s.plain, s.cached, s.ignoreWhitespace) + instance := buildWorkingTreeCommands(commonDeps{runner: s.runner, userConfig: userConfig, appState: appState}) + result := instance.WorktreeFileDiff(s.file, s.plain, s.cached) assert.Equal(t, expectedResult, result) s.runner.CheckForMissingCalls() }) @@ -374,10 +376,12 @@ func TestWorkingTreeShowFileDiff(t *testing.T) { t.Run(s.testName, func(t *testing.T) { userConfig := config.GetDefaultConfig() userConfig.Git.DiffContextSize = s.contextSize + appState := &config.AppState{} + appState.IgnoreWhitespaceInDiffView = s.ignoreWhitespace - instance := buildWorkingTreeCommands(commonDeps{runner: s.runner, userConfig: userConfig}) + instance := buildWorkingTreeCommands(commonDeps{runner: s.runner, userConfig: userConfig, appState: appState}) - result, err := instance.ShowFileDiff(s.from, s.to, s.reverse, "test.txt", s.plain, s.ignoreWhitespace) + result, err := instance.ShowFileDiff(s.from, s.to, s.reverse, "test.txt", s.plain) assert.NoError(t, err) assert.Equal(t, expectedResult, result) s.runner.CheckForMissingCalls() |