MCPcopy
hub / github.com/jesseduffield/lazygit / setupNestedSubmodules

Function setupNestedSubmodules

pkg/integration/tests/submodule/shared.go:7–39  ·  view source on GitHub ↗
(shell *Shell)

Source from the content-addressed store, hash-verified

5)
6
7func setupNestedSubmodules(shell *Shell) {
8 // we're going to have a directory structure like this:
9 // project
10 // - repo/modules/outerSubName/modules/innerSubName/
11 //
12 shell.CreateFileAndAdd("rootFile", "rootStuff")
13 shell.Commit("initial repo commit")
14
15 shell.Chdir("..")
16 shell.CreateDir("innerSubmodule")
17 shell.Chdir("innerSubmodule")
18 shell.Init()
19 shell.CreateFileAndAdd("inner", "inner")
20 shell.Commit("initial inner commit")
21
22 shell.Chdir("..")
23 shell.CreateDir("outerSubmodule")
24 shell.Chdir("outerSubmodule")
25 shell.Init()
26 shell.CreateFileAndAdd("outer", "outer")
27 shell.Commit("initial outer commit")
28 shell.CreateDir("modules")
29 // the git config (-c) parameter below is required
30 // to let git create a file-protocol/path submodule
31 shell.RunCommand([]string{"git", "-c", "protocol.file.allow=always", "submodule", "add", "--name", "innerSubName", "../innerSubmodule", "modules/innerSubPath"})
32 shell.Commit("add dependency as innerSubmodule")
33
34 shell.Chdir("../repo")
35 shell.CreateDir("modules")
36 shell.RunCommand([]string{"git", "-c", "protocol.file.allow=always", "submodule", "add", "--name", "outerSubName", "../outerSubmodule", "modules/outerSubPath"})
37 shell.Commit("add dependency as outerSubmodule")
38 shell.RunCommand([]string{"git", "-c", "protocol.file.allow=always", "submodule", "update", "--init", "--recursive"})
39}

Callers 2

enter_nested.goFile · 0.85
remove_nested.goFile · 0.85

Calls 6

CreateFileAndAddMethod · 0.80
CommitMethod · 0.80
ChdirMethod · 0.80
CreateDirMethod · 0.80
RunCommandMethod · 0.80
InitMethod · 0.45

Tested by

no test coverage detected