1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-06 22:33:07 +02:00

Commit only tracked files in tracked only filter view

This commit is contained in:
Partho Kunda
2025-03-17 22:51:10 +06:00
committed by Stefan Haller
parent 220f06052a
commit 7a1b63182d
6 changed files with 73 additions and 6 deletions

View File

@ -0,0 +1,56 @@
package filter_and_search
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var StagingFolderStagesOnlyTrackedFilesInTrackedOnlyFilter = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Staging entire folder in tracked only view, should stage only tracked files",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
},
SetupRepo: func(shell *Shell) {
shell.CreateDir("test")
shell.CreateFileAndAdd("test/file-tracked", "foo")
shell.Commit("first commit")
shell.CreateFile("test/file-untracked", "bar")
shell.UpdateFile("test/file-tracked", "baz")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Files().
Focus().
Lines(
Equals("▼ test").IsSelected(),
Equals(" M file-tracked"),
Equals(" ?? file-untracked"),
).
Press(keys.Files.OpenStatusFilter).
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Filtering")).
Select(Contains("Show only tracked files")).
Confirm()
}).
Lines(
Equals("▼ test").IsSelected(),
Equals(" M file-tracked"),
).
PressPrimaryAction().
Press(keys.Files.OpenStatusFilter).
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Filtering")).
Select(Contains("No filter")).
Confirm()
}).
Lines(
Equals("▼ test").IsSelected(),
Equals(" M file-tracked"), // 'M' is now in the left column, so file is staged
Equals(" ?? file-untracked"),
)
},
})

View File

@ -207,6 +207,7 @@ var tests = []*components.IntegrationTest{
filter_and_search.NestedFilter,
filter_and_search.NestedFilterTransient,
filter_and_search.NewSearch,
filter_and_search.StagingFolderStagesOnlyTrackedFilesInTrackedOnlyFilter,
filter_by_author.SelectAuthor,
filter_by_author.TypeAuthor,
filter_by_path.CliArg,