(shell *Shell)
| 5 | ) |
| 6 | |
| 7 | func 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 | } |
no test coverage detected