mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-04-07 19:17:06 +02:00
Set the sort order's default from the former foldersFirst to mixed, so this is a change in behavior. I find this useful because it now matches git's order, so if you look at the diff of a commit, the TOC at the top has the same order as the file tree you see when entering the commit.
58 lines
1.6 KiB
Go
58 lines
1.6 KiB
Go
package submodule
|
|
|
|
import (
|
|
"path/filepath"
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
var RemoveNested = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "Remove a nested submodule",
|
|
ExtraCmdArgs: []string{},
|
|
Skip: false,
|
|
SetupConfig: func(config *config.AppConfig) {},
|
|
SetupRepo: func(shell *Shell) {
|
|
setupNestedSubmodules(shell)
|
|
},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
gitDirSubmodulePath, _ := filepath.Abs(".git/modules/outerSubName/modules/innerSubName")
|
|
t.FileSystem().PathPresent(gitDirSubmodulePath)
|
|
|
|
t.Views().Submodules().Focus().
|
|
Lines(
|
|
Equals("outerSubName").IsSelected(),
|
|
Equals(" - innerSubName"),
|
|
).
|
|
SelectNextItem().
|
|
Press(keys.Universal.Remove).
|
|
Tap(func() {
|
|
t.ExpectPopup().Confirmation().
|
|
Title(Equals("Remove submodule")).
|
|
Content(Equals("Are you sure you want to remove submodule 'outerSubName/innerSubName' and its corresponding directory? This is irreversible.")).
|
|
Confirm()
|
|
}).
|
|
Lines(
|
|
Equals("outerSubName").IsSelected(),
|
|
).
|
|
Press(keys.Universal.GoInto)
|
|
|
|
t.Views().Files().IsFocused().
|
|
Lines(
|
|
Equals("▼ /").IsSelected(),
|
|
Equals(" M .gitmodules"),
|
|
Equals(" ▼ modules"),
|
|
Equals(" D innerSubPath"),
|
|
).
|
|
NavigateToLine(Contains(".gitmodules"))
|
|
|
|
t.Views().Main().Content(
|
|
Contains("-[submodule \"innerSubName\"]").
|
|
Contains("- path = modules/innerSubPath").
|
|
Contains("- url = ../innerSubmodule"),
|
|
)
|
|
|
|
t.FileSystem().PathNotPresent(gitDirSubmodulePath)
|
|
},
|
|
})
|