From 010f6d7f6ebc115401fa66c490b7227c5a9a7e53 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 12 Feb 2023 09:53:57 +1100 Subject: [PATCH 1/6] migrate submodule add test --- pkg/integration/components/prompt_driver.go | 5 +- pkg/integration/components/viewDriver.go | 63 ++++++++++++----- pkg/integration/tests/submodule/add.go | 65 ++++++++++++++++++ pkg/integration/tests/tests.go | 2 + .../submoduleAdd/expected/other_repo/HEAD | 1 - .../submoduleAdd/expected/other_repo/config | 8 --- .../expected/other_repo/description | 1 - .../expected/other_repo/info/exclude | 7 -- .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../42/530e986dbb65877ed8d61ca0c816e425e5c62e | Bin 150 -> 0 bytes .../a5/0a5125768001a3ea263ffb7cafbc421a508153 | 2 - .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../a7/341a59f0ddeef969e69fb6368266d22b0f2416 | Bin 77 -> 0 bytes .../expected/other_repo/packed-refs | 2 - .../expected/repo/.git_keep/COMMIT_EDITMSG | 1 - .../expected/repo/.git_keep/FETCH_HEAD | 0 .../submoduleAdd/expected/repo/.git_keep/HEAD | 1 - .../expected/repo/.git_keep/config | 13 ---- .../expected/repo/.git_keep/description | 1 - .../expected/repo/.git_keep/index | Bin 361 -> 0 bytes .../expected/repo/.git_keep/info/exclude | 7 -- .../expected/repo/.git_keep/logs/HEAD | 3 - .../repo/.git_keep/logs/refs/heads/master | 3 - .../expected/repo/.git_keep/modules/blah/HEAD | 1 - .../repo/.git_keep/modules/blah/config | 14 ---- .../repo/.git_keep/modules/blah/description | 1 - .../repo/.git_keep/modules/blah/index | Bin 209 -> 0 bytes .../repo/.git_keep/modules/blah/info/exclude | 7 -- .../repo/.git_keep/modules/blah/logs/HEAD | 1 - .../modules/blah/logs/refs/heads/master | 1 - .../blah/logs/refs/remotes/origin/HEAD | 1 - .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../42/530e986dbb65877ed8d61ca0c816e425e5c62e | Bin 150 -> 0 bytes .../a5/0a5125768001a3ea263ffb7cafbc421a508153 | 2 - .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../a7/341a59f0ddeef969e69fb6368266d22b0f2416 | Bin 77 -> 0 bytes .../repo/.git_keep/modules/blah/packed-refs | 2 - .../.git_keep/modules/blah/refs/heads/master | 1 - .../modules/blah/refs/remotes/origin/HEAD | 1 - .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../42/530e986dbb65877ed8d61ca0c816e425e5c62e | Bin 150 -> 0 bytes .../5f/77fb3622a1035782a7dacc0cca12e674066b9e | Bin 144 -> 0 bytes .../a5/0a5125768001a3ea263ffb7cafbc421a508153 | 2 - .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../a7/341a59f0ddeef969e69fb6368266d22b0f2416 | Bin 77 -> 0 bytes .../b9/7660affc790464b00ad45c7186a882238d77fb | Bin 67 -> 0 bytes .../dc/5bde4a09968b0819f34d193f6780df295d71cf | Bin 146 -> 0 bytes .../expected/repo/.git_keep/refs/heads/master | 1 - .../expected/repo/.gitmodules_keep | 3 - .../submoduleAdd/expected/repo/haha/.git_keep | 1 - .../submoduleAdd/expected/repo/haha/myfile1 | 1 - .../submoduleAdd/expected/repo/haha/myfile2 | 1 - .../submoduleAdd/expected/repo/myfile1 | 1 - .../submoduleAdd/expected/repo/myfile2 | 1 - test/integration/submoduleAdd/recording.json | 1 - test/integration/submoduleAdd/setup.sh | 29 -------- test/integration/submoduleAdd/test.json | 4 -- 60 files changed, 115 insertions(+), 147 deletions(-) create mode 100644 pkg/integration/tests/submodule/add.go delete mode 100644 test/integration/submoduleAdd/expected/other_repo/HEAD delete mode 100644 test/integration/submoduleAdd/expected/other_repo/config delete mode 100644 test/integration/submoduleAdd/expected/other_repo/description delete mode 100644 test/integration/submoduleAdd/expected/other_repo/info/exclude delete mode 100644 test/integration/submoduleAdd/expected/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/submoduleAdd/expected/other_repo/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/submoduleAdd/expected/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e delete mode 100644 test/integration/submoduleAdd/expected/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 delete mode 100644 test/integration/submoduleAdd/expected/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/submoduleAdd/expected/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 delete mode 100644 test/integration/submoduleAdd/expected/other_repo/packed-refs delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/COMMIT_EDITMSG delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/FETCH_HEAD delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/HEAD delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/config delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/description delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/index delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/info/exclude delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/logs/HEAD delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/logs/refs/heads/master delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/HEAD delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/config delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/description delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/index delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/info/exclude delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/logs/HEAD delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/logs/refs/heads/master delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/logs/refs/remotes/origin/HEAD delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/packed-refs delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/refs/heads/master delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/refs/remotes/origin/HEAD delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/objects/5f/77fb3622a1035782a7dacc0cca12e674066b9e delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/objects/b9/7660affc790464b00ad45c7186a882238d77fb delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/objects/dc/5bde4a09968b0819f34d193f6780df295d71cf delete mode 100644 test/integration/submoduleAdd/expected/repo/.git_keep/refs/heads/master delete mode 100644 test/integration/submoduleAdd/expected/repo/.gitmodules_keep delete mode 100644 test/integration/submoduleAdd/expected/repo/haha/.git_keep delete mode 100644 test/integration/submoduleAdd/expected/repo/haha/myfile1 delete mode 100644 test/integration/submoduleAdd/expected/repo/haha/myfile2 delete mode 100644 test/integration/submoduleAdd/expected/repo/myfile1 delete mode 100644 test/integration/submoduleAdd/expected/repo/myfile2 delete mode 100644 test/integration/submoduleAdd/recording.json delete mode 100644 test/integration/submoduleAdd/setup.sh delete mode 100644 test/integration/submoduleAdd/test.json diff --git a/pkg/integration/components/prompt_driver.go b/pkg/integration/components/prompt_driver.go index 83037a90d..45a6db513 100644 --- a/pkg/integration/components/prompt_driver.go +++ b/pkg/integration/components/prompt_driver.go @@ -32,7 +32,10 @@ func (self *PromptDriver) Type(value string) *PromptDriver { } func (self *PromptDriver) Clear() *PromptDriver { - panic("Clear method not yet implemented!") + // TODO: soft-code this + self.t.press("") + + return self } func (self *PromptDriver) Confirm() { diff --git a/pkg/integration/components/viewDriver.go b/pkg/integration/components/viewDriver.go index 238e04f55..04c58fc81 100644 --- a/pkg/integration/components/viewDriver.go +++ b/pkg/integration/components/viewDriver.go @@ -5,6 +5,7 @@ import ( "strings" "github.com/jesseduffield/gocui" + "github.com/samber/lo" ) type ViewDriver struct { @@ -104,32 +105,56 @@ func (self *ViewDriver) SelectedLineIdx(expected int) *ViewDriver { return self } -// focus the view (assumes the view is a side-view that can be focused via a keybinding) +// focus the view (assumes the view is a side-view) func (self *ViewDriver) Focus() *ViewDriver { - // we can easily change focus by switching to the view's window, but this assumes that the desired view - // is at the top of that window. So for now we'll switch to the window then assert that the desired - // view is on top (i.e. that it's the current view). - // If we want to support other views e.g. the tags view, we'll need to add more logic here. viewName := self.getView().Name() - // using a map rather than a slice because we might add other views which share a window index later - windowIndexMap := map[string]int{ - "status": 0, - "files": 1, - "localBranches": 2, - "commits": 3, - "stash": 4, + type window struct { + name string + viewNames []string + } + windows := []window{ + {name: "status", viewNames: []string{"status"}}, + {name: "files", viewNames: []string{"files", "submodules"}}, + {name: "branches", viewNames: []string{"localBranches", "remotes", "tags"}}, + {name: "commits", viewNames: []string{"commits", "reflogCommits"}}, + {name: "stash", viewNames: []string{"stash"}}, } - index, ok := windowIndexMap[viewName] - if !ok { - self.t.fail(fmt.Sprintf("Cannot focus view %s: Focus() method not implemented", viewName)) + for windowIndex, window := range windows { + if lo.Contains(window.viewNames, viewName) { + tabIndex := lo.IndexOf(window.viewNames, viewName) + // jump to the desired window + self.t.press(self.t.keys.Universal.JumpToBlock[windowIndex]) + + // assert we're in the window before continuing + self.t.assertWithRetries(func() (bool, string) { + currentWindowName := self.t.gui.CurrentContext().GetWindowName() + // by convention the window is named after the first view in the window + return currentWindowName == window.name, fmt.Sprintf("Expected to be in window '%s', but was in '%s'", window.name, currentWindowName) + }) + + // switch to the desired tab + currentViewName := self.t.gui.CurrentContext().GetViewName() + currentViewTabIndex := lo.IndexOf(window.viewNames, currentViewName) + if tabIndex > currentViewTabIndex { + for i := 0; i < tabIndex-currentViewTabIndex; i++ { + self.t.press(self.t.keys.Universal.NextTab) + } + } else if tabIndex < currentViewTabIndex { + for i := 0; i < currentViewTabIndex-tabIndex; i++ { + self.t.press(self.t.keys.Universal.PrevTab) + } + } + + // assert that we're now in the expected view + self.IsFocused() + + return self + } } - self.t.press(self.t.keys.Universal.JumpToBlock[index]) - - // assert that we land in the expected view - self.IsFocused() + self.t.fail(fmt.Sprintf("Cannot focus view %s: Focus() method not implemented", viewName)) return self } diff --git a/pkg/integration/tests/submodule/add.go b/pkg/integration/tests/submodule/add.go new file mode 100644 index 000000000..e04141499 --- /dev/null +++ b/pkg/integration/tests/submodule/add.go @@ -0,0 +1,65 @@ +package submodule + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var Add = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Add a submodule", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(config *config.AppConfig) {}, + SetupRepo: func(shell *Shell) { + shell.EmptyCommit("first commit") + shell.RunCommand("git clone --bare . ../other_repo") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Submodules().Focus(). + Press(keys.Universal.New). + Tap(func() { + t.ExpectPopup().Prompt(). + Title(Equals("new submodule URL:")). + Type("../other_repo").Confirm() + + t.ExpectPopup().Prompt(). + Title(Equals("new submodule name:")). + InitialText(Equals("other_repo")). + Clear().Type("my_submodule").Confirm() + + t.ExpectPopup().Prompt(). + Title(Equals("new submodule path:")). + InitialText(Equals("my_submodule")). + Clear().Type("my_submodule_path").Confirm() + }). + Lines( + Contains("my_submodule").IsSelected(), + ) + + t.Views().Main().TopLines( + Contains("Name: my_submodule"), + Contains("Path: my_submodule_path"), + Contains("Url: ../other_repo"), + ) + + t.Views().Files().Focus(). + Lines( + Contains(".gitmodules").IsSelected(), + Contains("my_submodule_path (submodule)"), + ). + Tap(func() { + t.Views().Main().Content( + Contains("[submodule \"my_submodule\"]"). + Contains("path = my_submodule_path"). + Contains("url = ../other_repo"), + ) + }). + SelectNextItem(). + Tap(func() { + t.Views().Main().Content( + Contains("Submodule my_submodule_path"). + Contains("(new submodule)"), + ) + }) + }, +}) diff --git a/pkg/integration/tests/tests.go b/pkg/integration/tests/tests.go index af3ef4050..d04bb7869 100644 --- a/pkg/integration/tests/tests.go +++ b/pkg/integration/tests/tests.go @@ -23,6 +23,7 @@ import ( "github.com/jesseduffield/lazygit/pkg/integration/tests/misc" "github.com/jesseduffield/lazygit/pkg/integration/tests/patch_building" "github.com/jesseduffield/lazygit/pkg/integration/tests/stash" + "github.com/jesseduffield/lazygit/pkg/integration/tests/submodule" "github.com/jesseduffield/lazygit/pkg/integration/tests/sync" ) @@ -75,6 +76,7 @@ var tests = []*components.IntegrationTest{ filter_by_path.SelectFile, filter_by_path.TypeFile, patch_building.BuildPatchAndCopyToClipboard, + submodule.Add, } func GetTests() []*components.IntegrationTest { diff --git a/test/integration/submoduleAdd/expected/other_repo/HEAD b/test/integration/submoduleAdd/expected/other_repo/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/submoduleAdd/expected/other_repo/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/submoduleAdd/expected/other_repo/config b/test/integration/submoduleAdd/expected/other_repo/config deleted file mode 100644 index e5abd1a6d..000000000 --- a/test/integration/submoduleAdd/expected/other_repo/config +++ /dev/null @@ -1,8 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = true - ignorecase = true - precomposeunicode = true -[remote "origin"] - url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleAdd/actual/./repo diff --git a/test/integration/submoduleAdd/expected/other_repo/description b/test/integration/submoduleAdd/expected/other_repo/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/submoduleAdd/expected/other_repo/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleAdd/expected/other_repo/info/exclude b/test/integration/submoduleAdd/expected/other_repo/info/exclude deleted file mode 100644 index 8e9f2071f..000000000 --- a/test/integration/submoduleAdd/expected/other_repo/info/exclude +++ /dev/null @@ -1,7 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ -.DS_Store diff --git a/test/integration/submoduleAdd/expected/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleAdd/expected/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmb~ZE#08nZNMgRZ+ diff --git a/test/integration/submoduleAdd/expected/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleAdd/expected/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e deleted file mode 100644 index 64d20cb1ea175608a3e05acff298a97ed57eb7b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 150 zcmV;H0BQet0gaA93c@fDMP26<*$Xn6B$Eb2gsyswNjrlDV@rvkw>L*{``_d7=dISY zS(n499U_*K4~}D2SQZh@l!dYu@-!gPf>=N?I5ImQ@@keNaC8_G4FHb4Fp^g-X=W{R zz}|wvMQ`}s9@}BZ$zI3lE+4M@Q!evXZ?@x*GNzdA861G=Yd_WGPu`~^A08nuUMF0Q* diff --git a/test/integration/submoduleAdd/expected/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleAdd/expected/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 deleted file mode 100644 index 96d2e71a6af75cdd27ac5d9628a27faecc40fb66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77 zcmV-T0J8sh0V^p=O;s>AU@$Z=Ff%bx$gNDv%tB=N-?^8o7KK;!x4hDxZ=ntVWIZ01*pecg diff --git a/test/integration/submoduleAdd/expected/other_repo/packed-refs b/test/integration/submoduleAdd/expected/other_repo/packed-refs deleted file mode 100644 index 62f6568b2..000000000 --- a/test/integration/submoduleAdd/expected/other_repo/packed-refs +++ /dev/null @@ -1,2 +0,0 @@ -# pack-refs with: peeled fully-peeled sorted -42530e986dbb65877ed8d61ca0c816e425e5c62e refs/heads/master diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/submoduleAdd/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 9daeafb98..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/FETCH_HEAD b/test/integration/submoduleAdd/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/HEAD b/test/integration/submoduleAdd/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/config b/test/integration/submoduleAdd/expected/repo/.git_keep/config deleted file mode 100644 index 22f6527ea..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/config +++ /dev/null @@ -1,13 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true -[user] - email = CI@example.com - name = CI -[submodule "blah"] - url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleAdd/actual/other_repo - active = true diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/description b/test/integration/submoduleAdd/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/index b/test/integration/submoduleAdd/expected/repo/.git_keep/index deleted file mode 100644 index 4690b27b142d6aca4910bd85b96f2d8b2ee21fc5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 361 zcmZ?q402{*U|<4bmL&Vr2MtQO7l7%aFTIQm46ICZKl(5*G%jIaVEhVHBLc*xJIfN* z|EXk2*}!!rrm$^AlX7qQZw79?^vsgn{FKt1)MB6_5CEB@Z`G^|qoL+8GcY^=%EHZC z;1tX^BX@Udd)zC?sZ@#H&Q2=Hp@zRJL!TbY)blWGVxM 1534792759 +0100 commit (initial): myfile1 -a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 -42530e986dbb65877ed8d61ca0c816e425e5c62e dc5bde4a09968b0819f34d193f6780df295d71cf CI 1648348101 +1100 commit: test diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/submoduleAdd/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index 58db0ace2..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 a50a5125768001a3ea263ffb7cafbc421a508153 CI 1534792759 +0100 commit (initial): myfile1 -a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 -42530e986dbb65877ed8d61ca0c816e425e5c62e dc5bde4a09968b0819f34d193f6780df295d71cf CI 1648348101 +1100 commit: test diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/HEAD b/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/config b/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/config deleted file mode 100644 index 39065f535..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/config +++ /dev/null @@ -1,14 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true - worktree = ../../../haha -[remote "origin"] - url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleAdd/actual/other_repo - fetch = +refs/heads/*:refs/remotes/origin/* -[branch "master"] - remote = origin - merge = refs/heads/master diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/description b/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/index b/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/index deleted file mode 100644 index 27523e56e3e7753bb1e731cd0fb670175330790e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 209 zcmZ?q402{*U|<5_B>U3`^(`K-!e~YY23DrIAKe)k8kaCIFn$H95dmVhrF$O#RZYF| zB_cG6C*SEpfLBZRRR;Fl%CyX!R70Qwuzp*;`!E`6jt9Cq5+cvXMP zEA9Cf>M(PRfaZh*xw--=Nd_YY1Fq#JQjs6-zWbT^Z2mU0rnF1i{3>Gqw{2*6eDl4R Q)TQQRcbSeN{w}fG0P8JB$^ZZW diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/info/exclude b/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/info/exclude deleted file mode 100644 index 8e9f2071f..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/info/exclude +++ /dev/null @@ -1,7 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ -.DS_Store diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/logs/HEAD b/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/logs/HEAD deleted file mode 100644 index 502ae05d9..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/logs/HEAD +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1648348097 +1100 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleAdd/actual/other_repo diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/logs/refs/heads/master b/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/logs/refs/heads/master deleted file mode 100644 index 502ae05d9..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/logs/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1648348097 +1100 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleAdd/actual/other_repo diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/logs/refs/remotes/origin/HEAD b/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/logs/refs/remotes/origin/HEAD deleted file mode 100644 index 502ae05d9..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/logs/refs/remotes/origin/HEAD +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1648348097 +1100 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleAdd/actual/other_repo diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmb~ZE#08nZNMgRZ+ diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e deleted file mode 100644 index 64d20cb1ea175608a3e05acff298a97ed57eb7b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 150 zcmV;H0BQet0gaA93c@fDMP26<*$Xn6B$Eb2gsyswNjrlDV@rvkw>L*{``_d7=dISY zS(n499U_*K4~}D2SQZh@l!dYu@-!gPf>=N?I5ImQ@@keNaC8_G4FHb4Fp^g-X=W{R zz}|wvMQ`}s9@}BZ$zI3lE+4M@Q!evXZ?@x*GNzdA861G=Yd_WGPu`~^A08nuUMF0Q* diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 deleted file mode 100644 index 96d2e71a6af75cdd27ac5d9628a27faecc40fb66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77 zcmV-T0J8sh0V^p=O;s>AU@$Z=Ff%bx$gNDv%tB=N-?^8o7KK;!x4hDxZ=ntVWIZ01*pecg diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/packed-refs b/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/packed-refs deleted file mode 100644 index 2991aad64..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/packed-refs +++ /dev/null @@ -1,2 +0,0 @@ -# pack-refs with: peeled fully-peeled sorted -42530e986dbb65877ed8d61ca0c816e425e5c62e refs/remotes/origin/master diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/refs/heads/master b/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/refs/heads/master deleted file mode 100644 index a70ff80c0..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -42530e986dbb65877ed8d61ca0c816e425e5c62e diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/refs/remotes/origin/HEAD b/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/refs/remotes/origin/HEAD deleted file mode 100644 index 6efe28fff..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/modules/blah/refs/remotes/origin/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/remotes/origin/master diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleAdd/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmb~ZE#08nZNMgRZ+ diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleAdd/expected/repo/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e deleted file mode 100644 index 64d20cb1ea175608a3e05acff298a97ed57eb7b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 150 zcmV;H0BQet0gaA93c@fDMP26<*$Xn6B$Eb2gsyswNjrlDV@rvkw>L*{``_d7=dISY zS(n499U_*K4~}D2SQZh@l!dYu@-!gPf>=N?I5ImQ@@keNaC8_G4FHb4Fp^g-X=W{R zz}|wvMQ`}s9@}BZ$zI3lE+4M@Q!evXZ?@x*GNzdA861G=Yd_WGPu7F=Q|_FfcPQQP4}zEXmDJDa}bOX4qMlu>MaaOUeeWD=~#_ zE1Hyh%YPf1832JoMq)-HgHtfyjNIL+?R7V<$t*Y__C)pRF+Hd;xs_>|IjM#WOZPnf ytD1V_OGIcCPrlQI0I!zrt0+p07$kUp7&R#EJNI(cqVTHzmRH*IEz|+MIXjmQ#zA-h diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 b/test/integration/submoduleAdd/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 deleted file mode 100644 index 5dd5f3236..000000000 --- a/test/integration/submoduleAdd/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 +++ /dev/null @@ -1,2 +0,0 @@ -xM -0@sJ&N  I޾/ZHR%d"r@X<-4dG5?fxN(_& 6]פ˟\ճ5, \ No newline at end of file diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/submoduleAdd/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 deleted file mode 100644 index 285df3e5fbab12262e28d85e78af8a31cd0024c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb`~^A08nuUMF0Q* diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleAdd/expected/repo/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 deleted file mode 100644 index 96d2e71a6af75cdd27ac5d9628a27faecc40fb66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77 zcmV-T0J8sh0V^p=O;s>AU@$Z=Ff%bx$gNDv%tB=N-?^8o7KK;!x4hDxZ=ntVWIZ01*pecg diff --git a/test/integration/submoduleAdd/expected/repo/.git_keep/objects/b9/7660affc790464b00ad45c7186a882238d77fb b/test/integration/submoduleAdd/expected/repo/.git_keep/objects/b9/7660affc790464b00ad45c7186a882238d77fb deleted file mode 100644 index c4d570c9dfb86a4f2c3724727b92592c87badd56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67 zcmV-J0KETr0ZYosPf{>7W{55>P0GzrDa}b$P)f>4%utHu;w(rk$xyIW$VkjcwB|}E43d%b z&>DrD8vgYAy4z{C<22v&%WZq=Mb>t;NFn=>5zw9y0n9; myfile1 -git add . -git commit -am "myfile1" -echo test2 > myfile2 -git add . -git commit -am "myfile2" - -cd .. -git clone --bare ./repo other_repo -cd repo diff --git a/test/integration/submoduleAdd/test.json b/test/integration/submoduleAdd/test.json deleted file mode 100644 index d937c5747..000000000 --- a/test/integration/submoduleAdd/test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "description": "Add submodule", - "speed": 5 -} From 1c4884227777773de7ba9e1906a77601020e369c Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 12 Feb 2023 10:01:45 +1100 Subject: [PATCH 2/6] migrate submodule remove test --- pkg/integration/tests/submodule/remove.go | 46 ++++++++++++++++++ pkg/integration/tests/tests.go | 1 + .../submoduleRemove/expected/other_repo/HEAD | 1 - .../expected/other_repo/config | 8 --- .../expected/other_repo/description | 1 - .../expected/other_repo/info/exclude | 7 --- .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../42/530e986dbb65877ed8d61ca0c816e425e5c62e | Bin 150 -> 0 bytes .../a5/0a5125768001a3ea263ffb7cafbc421a508153 | 2 - .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../a7/341a59f0ddeef969e69fb6368266d22b0f2416 | Bin 77 -> 0 bytes .../expected/other_repo/packed-refs | 2 - .../expected/repo/.git_keep/COMMIT_EDITMSG | 1 - .../expected/repo/.git_keep/FETCH_HEAD | 0 .../expected/repo/.git_keep/HEAD | 1 - .../expected/repo/.git_keep/config | 10 ---- .../expected/repo/.git_keep/description | 1 - .../expected/repo/.git_keep/index | Bin 289 -> 0 bytes .../expected/repo/.git_keep/info/exclude | 7 --- .../expected/repo/.git_keep/logs/HEAD | 4 -- .../repo/.git_keep/logs/refs/heads/master | 4 -- .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../2b/864257bf2d49adbad8785540d85030a60852ff | Bin 62 -> 0 bytes .../2e/eb2c1e6451d1318b506eecddf936b59a5f32b8 | Bin 150 -> 0 bytes .../42/530e986dbb65877ed8d61ca0c816e425e5c62e | Bin 150 -> 0 bytes .../61/1cac756ef1944ab56d12f4ea3ae4623724c8cf | Bin 155 -> 0 bytes .../9d/10a5a0a21eb2cfdb6206f474ed57fd5cd51440 | Bin 152 -> 0 bytes .../a5/0a5125768001a3ea263ffb7cafbc421a508153 | 2 - .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../a7/341a59f0ddeef969e69fb6368266d22b0f2416 | Bin 77 -> 0 bytes .../e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 | Bin 15 -> 0 bytes .../f1/43043bb53b17b5727a43b6cfbb1a8d1f5a222d | Bin 113 -> 0 bytes .../expected/repo/.git_keep/refs/heads/master | 1 - .../expected/repo/.gitmodules_keep | 0 .../submoduleRemove/expected/repo/myfile1 | 1 - .../submoduleRemove/expected/repo/myfile2 | 1 - .../submoduleRemove/recording.json | 1 - test/integration/submoduleRemove/setup.sh | 27 ---------- test/integration/submoduleRemove/test.json | 4 -- 41 files changed, 47 insertions(+), 86 deletions(-) create mode 100644 pkg/integration/tests/submodule/remove.go delete mode 100644 test/integration/submoduleRemove/expected/other_repo/HEAD delete mode 100644 test/integration/submoduleRemove/expected/other_repo/config delete mode 100644 test/integration/submoduleRemove/expected/other_repo/description delete mode 100644 test/integration/submoduleRemove/expected/other_repo/info/exclude delete mode 100644 test/integration/submoduleRemove/expected/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/submoduleRemove/expected/other_repo/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/submoduleRemove/expected/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e delete mode 100644 test/integration/submoduleRemove/expected/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 delete mode 100644 test/integration/submoduleRemove/expected/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/submoduleRemove/expected/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 delete mode 100644 test/integration/submoduleRemove/expected/other_repo/packed-refs delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/COMMIT_EDITMSG delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/FETCH_HEAD delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/HEAD delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/config delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/description delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/index delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/info/exclude delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/logs/HEAD delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/logs/refs/heads/master delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/objects/2e/eb2c1e6451d1318b506eecddf936b59a5f32b8 delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/objects/61/1cac756ef1944ab56d12f4ea3ae4623724c8cf delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/objects/9d/10a5a0a21eb2cfdb6206f474ed57fd5cd51440 delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/objects/f1/43043bb53b17b5727a43b6cfbb1a8d1f5a222d delete mode 100644 test/integration/submoduleRemove/expected/repo/.git_keep/refs/heads/master delete mode 100644 test/integration/submoduleRemove/expected/repo/.gitmodules_keep delete mode 100644 test/integration/submoduleRemove/expected/repo/myfile1 delete mode 100644 test/integration/submoduleRemove/expected/repo/myfile2 delete mode 100644 test/integration/submoduleRemove/recording.json delete mode 100644 test/integration/submoduleRemove/setup.sh delete mode 100644 test/integration/submoduleRemove/test.json diff --git a/pkg/integration/tests/submodule/remove.go b/pkg/integration/tests/submodule/remove.go new file mode 100644 index 000000000..0a8884e15 --- /dev/null +++ b/pkg/integration/tests/submodule/remove.go @@ -0,0 +1,46 @@ +package submodule + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var Remove = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Remove a submodule", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(config *config.AppConfig) {}, + SetupRepo: func(shell *Shell) { + shell.EmptyCommit("first commit") + shell.RunCommand("git clone --bare . ../other_repo") + shell.RunCommand("git submodule add ../other_repo my_submodule") + shell.GitAddAll() + shell.Commit("add submodule") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Submodules().Focus(). + Lines( + Contains("my_submodule").IsSelected(), + ). + Press(keys.Universal.Remove). + Tap(func() { + t.ExpectPopup().Confirmation(). + Title(Equals("Remove submodule")). + Content(Equals("Are you sure you want to remove submodule 'my_submodule' and its corresponding directory? This is irreversible.")). + Confirm() + }). + IsEmpty() + + t.Views().Files().Focus(). + Lines( + MatchesRegexp(`M.*\.gitmodules`).IsSelected(), + MatchesRegexp(`D.*my_submodule`), + ) + + t.Views().Main().Content( + Contains("-[submodule \"my_submodule\"]"). + Contains("- path = my_submodule"). + Contains("- url = ../other_repo"), + ) + }, +}) diff --git a/pkg/integration/tests/tests.go b/pkg/integration/tests/tests.go index d04bb7869..79bb5a84c 100644 --- a/pkg/integration/tests/tests.go +++ b/pkg/integration/tests/tests.go @@ -77,6 +77,7 @@ var tests = []*components.IntegrationTest{ filter_by_path.TypeFile, patch_building.BuildPatchAndCopyToClipboard, submodule.Add, + submodule.Remove, } func GetTests() []*components.IntegrationTest { diff --git a/test/integration/submoduleRemove/expected/other_repo/HEAD b/test/integration/submoduleRemove/expected/other_repo/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/submoduleRemove/expected/other_repo/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/submoduleRemove/expected/other_repo/config b/test/integration/submoduleRemove/expected/other_repo/config deleted file mode 100644 index e710ce53e..000000000 --- a/test/integration/submoduleRemove/expected/other_repo/config +++ /dev/null @@ -1,8 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = true - ignorecase = true - precomposeunicode = true -[remote "origin"] - url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleRemove/actual/./repo diff --git a/test/integration/submoduleRemove/expected/other_repo/description b/test/integration/submoduleRemove/expected/other_repo/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/submoduleRemove/expected/other_repo/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleRemove/expected/other_repo/info/exclude b/test/integration/submoduleRemove/expected/other_repo/info/exclude deleted file mode 100644 index 8e9f2071f..000000000 --- a/test/integration/submoduleRemove/expected/other_repo/info/exclude +++ /dev/null @@ -1,7 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ -.DS_Store diff --git a/test/integration/submoduleRemove/expected/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleRemove/expected/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmb~ZE#08nZNMgRZ+ diff --git a/test/integration/submoduleRemove/expected/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleRemove/expected/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e deleted file mode 100644 index 64d20cb1ea175608a3e05acff298a97ed57eb7b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 150 zcmV;H0BQet0gaA93c@fDMP26<*$Xn6B$Eb2gsyswNjrlDV@rvkw>L*{``_d7=dISY zS(n499U_*K4~}D2SQZh@l!dYu@-!gPf>=N?I5ImQ@@keNaC8_G4FHb4Fp^g-X=W{R zz}|wvMQ`}s9@}BZ$zI3lE+4M@Q!evXZ?@x*GNzdA861G=Yd_WGPu`~^A08nuUMF0Q* diff --git a/test/integration/submoduleRemove/expected/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleRemove/expected/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 deleted file mode 100644 index 96d2e71a6af75cdd27ac5d9628a27faecc40fb66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77 zcmV-T0J8sh0V^p=O;s>AU@$Z=Ff%bx$gNDv%tB=N-?^8o7KK;!x4hDxZ=ntVWIZ01*pecg diff --git a/test/integration/submoduleRemove/expected/other_repo/packed-refs b/test/integration/submoduleRemove/expected/other_repo/packed-refs deleted file mode 100644 index 62f6568b2..000000000 --- a/test/integration/submoduleRemove/expected/other_repo/packed-refs +++ /dev/null @@ -1,2 +0,0 @@ -# pack-refs with: peeled fully-peeled sorted -42530e986dbb65877ed8d61ca0c816e425e5c62e refs/heads/master diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/submoduleRemove/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 5b256d7d3..000000000 --- a/test/integration/submoduleRemove/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -remove submodule diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/FETCH_HEAD b/test/integration/submoduleRemove/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/HEAD b/test/integration/submoduleRemove/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/submoduleRemove/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/config b/test/integration/submoduleRemove/expected/repo/.git_keep/config deleted file mode 100644 index 8ae104545..000000000 --- a/test/integration/submoduleRemove/expected/repo/.git_keep/config +++ /dev/null @@ -1,10 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true -[user] - email = CI@example.com - name = CI diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/description b/test/integration/submoduleRemove/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/submoduleRemove/expected/repo/.git_keep/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/index b/test/integration/submoduleRemove/expected/repo/.git_keep/index deleted file mode 100644 index 93d0089f1521d8e39b7fd992df8569443921e096..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 289 zcmZ?q402{*U|<4b<|O;mk9jT!%Yo_h+mjd>7+9I+e$8TFXk5a;!1xuYMg)i%p3QwU zd(*{h&feXc>&l~U9D33dJduH0FFms)H$SB`C$$))2nc}YJTPA)z8OYC%=@wi%{;cH zdmjH)O}+6YA~cF8-|0etS4;O*2KL;_w9K4TL#R0x-7k4T=74CZIfu~Ak>L4Z)S$HQ z+{;yq!mIjQUTM#_P=}dg1T-fk$ki1{NirBK7;t@bX0hICExxs=%6Z%Q-BP{sQA)a( Y%oDzEerr8>qKd%BKT%IhE7@C00a6iV9{>OV diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/info/exclude b/test/integration/submoduleRemove/expected/repo/.git_keep/info/exclude deleted file mode 100644 index 8e9f2071f..000000000 --- a/test/integration/submoduleRemove/expected/repo/.git_keep/info/exclude +++ /dev/null @@ -1,7 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ -.DS_Store diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/logs/HEAD b/test/integration/submoduleRemove/expected/repo/.git_keep/logs/HEAD deleted file mode 100644 index 34e702d94..000000000 --- a/test/integration/submoduleRemove/expected/repo/.git_keep/logs/HEAD +++ /dev/null @@ -1,4 +0,0 @@ -0000000000000000000000000000000000000000 a50a5125768001a3ea263ffb7cafbc421a508153 CI 1534792759 +0100 commit (initial): myfile1 -a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 -42530e986dbb65877ed8d61ca0c816e425e5c62e 9d10a5a0a21eb2cfdb6206f474ed57fd5cd51440 CI 1534792759 +0100 commit: add submodule -9d10a5a0a21eb2cfdb6206f474ed57fd5cd51440 611cac756ef1944ab56d12f4ea3ae4623724c8cf CI 1648348134 +1100 commit: remove submodule diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/submoduleRemove/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index 34e702d94..000000000 --- a/test/integration/submoduleRemove/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1,4 +0,0 @@ -0000000000000000000000000000000000000000 a50a5125768001a3ea263ffb7cafbc421a508153 CI 1534792759 +0100 commit (initial): myfile1 -a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 -42530e986dbb65877ed8d61ca0c816e425e5c62e 9d10a5a0a21eb2cfdb6206f474ed57fd5cd51440 CI 1534792759 +0100 commit: add submodule -9d10a5a0a21eb2cfdb6206f474ed57fd5cd51440 611cac756ef1944ab56d12f4ea3ae4623724c8cf CI 1648348134 +1100 commit: remove submodule diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleRemove/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmb~ZE#08nZNMgRZ+ diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff b/test/integration/submoduleRemove/expected/repo/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff deleted file mode 100644 index 5bfb0cefc3370964e04c1d101231d7a71600af5a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 62 zcmV-E0Kxxw0ZYosPf{>5Wr!{=P0GzrDa}b$P|7dKNG*ylN-fA&isj-gNG!=vuvI_^ Ua&eXx7F=sF|FfcPQQP4}zEXmDJDa}bOX3%bP3g55mxpvo$icp6e z0S3!Bg8oC5eFL-0IJ$O E95viYm;e9( diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleRemove/expected/repo/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e deleted file mode 100644 index 64d20cb1ea175608a3e05acff298a97ed57eb7b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 150 zcmV;H0BQet0gaA93c@fDMP26<*$Xn6B$Eb2gsyswNjrlDV@rvkw>L*{``_d7=dISY zS(n499U_*K4~}D2SQZh@l!dYu@-!gPf>=N?I5ImQ@@keNaC8_G4FHb4Fp^g-X=W{R zz}|wvMQ`}s9@}BZ$zI3lE+4M@Q!evXZ?@x*GNzdA861G=Yd_WGPuEA3&@p?*5ZOl?X~&QXGtiWwc(T@JwNjVY(B}+>JQ=beY*Wb`tO*4pO7^j2 zpRxx;qi7rV*7dyT%e>s=OLcw9DYbgl5O8uhfkS-+Fh=cmpBnOKuDaCr5&hn{w!A$> J{Qx2;K3{PtOQ`?= diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/objects/9d/10a5a0a21eb2cfdb6206f474ed57fd5cd51440 b/test/integration/submoduleRemove/expected/repo/.git_keep/objects/9d/10a5a0a21eb2cfdb6206f474ed57fd5cd51440 deleted file mode 100644 index d63e62eeca50a7809f2ff6d9a906526fbe697acf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 152 zcmV;J0B8Sr0gaA93c@fH1zqP9*$a}N^rs1k2wn9UN&YJe#*~_Z$G1mtJ2Q(Zt=4DP z)|gY@0BwP63&9UeLXJXaf02NDxmYnG(q3 z(BR@NRNDKaZF-vZb(-(^rni2Ozo33# G*F5F}&`WRt diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 b/test/integration/submoduleRemove/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 deleted file mode 100644 index 5dd5f3236..000000000 --- a/test/integration/submoduleRemove/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 +++ /dev/null @@ -1,2 +0,0 @@ -xM -0@sJ&N  I޾/ZHR%d"r@X<-4dG5?fxN(_& 6]פ˟\ճ5, \ No newline at end of file diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/submoduleRemove/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 deleted file mode 100644 index 285df3e5fbab12262e28d85e78af8a31cd0024c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb`~^A08nuUMF0Q* diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleRemove/expected/repo/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 deleted file mode 100644 index 96d2e71a6af75cdd27ac5d9628a27faecc40fb66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77 zcmV-T0J8sh0V^p=O;s>AU@$Z=Ff%bx$gNDv%tB=N-?^8o7KK;!x4hDxZ=ntVWIZ01*pecg diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/test/integration/submoduleRemove/expected/repo/.git_keep/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 deleted file mode 100644 index 711223894375fe1186ac5bfffdc48fb1fa1e65cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15 Wcmb7uw*baFfcPQQP4}zEXmDJDa}bOW_ULD(dKa3ib_MLmV TYEgJqf6FWF`4;K`*qtzo-d;0c diff --git a/test/integration/submoduleRemove/expected/repo/.git_keep/refs/heads/master b/test/integration/submoduleRemove/expected/repo/.git_keep/refs/heads/master deleted file mode 100644 index 6c6578e0b..000000000 --- a/test/integration/submoduleRemove/expected/repo/.git_keep/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -611cac756ef1944ab56d12f4ea3ae4623724c8cf diff --git a/test/integration/submoduleRemove/expected/repo/.gitmodules_keep b/test/integration/submoduleRemove/expected/repo/.gitmodules_keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/submoduleRemove/expected/repo/myfile1 b/test/integration/submoduleRemove/expected/repo/myfile1 deleted file mode 100644 index a5bce3fd2..000000000 --- a/test/integration/submoduleRemove/expected/repo/myfile1 +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/test/integration/submoduleRemove/expected/repo/myfile2 b/test/integration/submoduleRemove/expected/repo/myfile2 deleted file mode 100644 index 180cf8328..000000000 --- a/test/integration/submoduleRemove/expected/repo/myfile2 +++ /dev/null @@ -1 +0,0 @@ -test2 diff --git a/test/integration/submoduleRemove/recording.json b/test/integration/submoduleRemove/recording.json deleted file mode 100644 index ad22a348d..000000000 --- a/test/integration/submoduleRemove/recording.json +++ /dev/null @@ -1 +0,0 @@ -{"KeyEvents":[{"Timestamp":912,"Mod":0,"Key":256,"Ch":93},{"Timestamp":1280,"Mod":0,"Key":256,"Ch":100},{"Timestamp":1696,"Mod":0,"Key":13,"Ch":13},{"Timestamp":2544,"Mod":0,"Key":256,"Ch":91},{"Timestamp":2984,"Mod":0,"Key":256,"Ch":99},{"Timestamp":3680,"Mod":0,"Key":256,"Ch":114},{"Timestamp":3736,"Mod":0,"Key":256,"Ch":101},{"Timestamp":3824,"Mod":0,"Key":256,"Ch":109},{"Timestamp":3872,"Mod":0,"Key":256,"Ch":111},{"Timestamp":3944,"Mod":0,"Key":256,"Ch":118},{"Timestamp":3976,"Mod":0,"Key":256,"Ch":101},{"Timestamp":4064,"Mod":0,"Key":256,"Ch":32},{"Timestamp":4152,"Mod":0,"Key":256,"Ch":115},{"Timestamp":4248,"Mod":0,"Key":256,"Ch":117},{"Timestamp":4320,"Mod":0,"Key":256,"Ch":98},{"Timestamp":4560,"Mod":0,"Key":256,"Ch":109},{"Timestamp":4632,"Mod":0,"Key":256,"Ch":111},{"Timestamp":4720,"Mod":0,"Key":256,"Ch":100},{"Timestamp":4824,"Mod":0,"Key":256,"Ch":117},{"Timestamp":4880,"Mod":0,"Key":256,"Ch":108},{"Timestamp":4944,"Mod":0,"Key":256,"Ch":101},{"Timestamp":5152,"Mod":0,"Key":13,"Ch":13},{"Timestamp":5648,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]} \ No newline at end of file diff --git a/test/integration/submoduleRemove/setup.sh b/test/integration/submoduleRemove/setup.sh deleted file mode 100644 index cd5b3ce64..000000000 --- a/test/integration/submoduleRemove/setup.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -set -e - -cd $1 - -export GIT_COMMITTER_DATE="Mon 20 Aug 2018 20:19:19 BST" -export GIT_AUTHOR_DATE="Mon 20 Aug 2018 20:19:19 BST" - -git init - -git config user.email "CI@example.com" -git config user.name "CI" - -echo test1 > myfile1 -git add . -git commit -am "myfile1" -echo test2 > myfile2 -git add . -git commit -am "myfile2" - -cd .. -git clone --bare ./repo other_repo -cd repo - -git -c protocol.file.allow=always submodule add ../other_repo -git commit -am "add submodule" diff --git a/test/integration/submoduleRemove/test.json b/test/integration/submoduleRemove/test.json deleted file mode 100644 index 87daa5360..000000000 --- a/test/integration/submoduleRemove/test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "description": "Remove a submodule", - "speed": 20 -} From 08c2b46d0498926d928d02da7f1c3cbf35aceec6 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 12 Feb 2023 10:09:55 +1100 Subject: [PATCH 3/6] better visibility for tui --- pkg/integration/clients/tui.go | 1 + pkg/integration/deprecated/cmd/tui/main.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/integration/clients/tui.go b/pkg/integration/clients/tui.go index e6b3f53cf..dc4e1b5b0 100644 --- a/pkg/integration/clients/tui.go +++ b/pkg/integration/clients/tui.go @@ -307,6 +307,7 @@ func (self *app) layout(g *gocui.Gui) error { } listView.Highlight = true + listView.SelBgColor = gocui.ColorBlue self.renderTests() listView.Title = "Tests" listView.FgColor = gocui.ColorDefault diff --git a/pkg/integration/deprecated/cmd/tui/main.go b/pkg/integration/deprecated/cmd/tui/main.go index a36ac5585..b7fc45d5c 100644 --- a/pkg/integration/deprecated/cmd/tui/main.go +++ b/pkg/integration/deprecated/cmd/tui/main.go @@ -348,6 +348,7 @@ func (app *App) layout(g *gocui.Gui) error { return err } listView.Highlight = true + listView.SelBgColor = gocui.ColorBlue listView.Clear() for _, test := range app.tests { fmt.Fprintln(listView, test.Name) From 7a3291a1f78977cff6372f81e044675e88b25d46 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 12 Feb 2023 10:21:13 +1100 Subject: [PATCH 4/6] fix test --- pkg/integration/components/runner.go | 28 ++++++++++++++++------------ test/global_git_config | 8 ++++++++ 2 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 test/global_git_config diff --git a/pkg/integration/components/runner.go b/pkg/integration/components/runner.go index 2b05d102e..394ac00df 100644 --- a/pkg/integration/components/runner.go +++ b/pkg/integration/components/runner.go @@ -14,8 +14,9 @@ import ( // this is the integration runner for the new and improved integration interface const ( - TEST_NAME_ENV_VAR = "TEST_NAME" - SANDBOX_ENV_VAR = "SANDBOX" + TEST_NAME_ENV_VAR = "TEST_NAME" + SANDBOX_ENV_VAR = "SANDBOX" + GIT_CONFIG_GLOBAL_ENV_VAR = "GIT_CONFIG_GLOBAL" ) func RunTests( @@ -82,7 +83,7 @@ func runTest( logf("path: %s", paths.Root()) - if err := prepareTestDir(test, paths); err != nil { + if err := prepareTestDir(test, paths, projectRootDir); err != nil { return err } @@ -102,6 +103,7 @@ func runTest( func prepareTestDir( test *IntegrationTest, paths Paths, + rootDir string, ) error { findOrCreateDir(paths.Root()) deleteAndRecreateEmptyDir(paths.Actual()) @@ -111,7 +113,7 @@ func prepareTestDir( return err } - return createFixture(test, paths) + return createFixture(test, paths, rootDir) } func buildLazygit() error { @@ -125,28 +127,30 @@ func buildLazygit() error { )).Run() } -func createFixture(test *IntegrationTest, paths Paths) error { +func createFixture(test *IntegrationTest, paths Paths, rootDir string) error { shell := NewShell(paths.ActualRepo(), func(errorMsg string) { panic(errorMsg) }) shell.RunCommand("git init -b master") - shell.RunCommand(`git config user.email "CI@example.com"`) - shell.RunCommand(`git config user.name "CI"`) - shell.RunCommand(`git config commit.gpgSign false`) - shell.RunCommand(`git config protocol.file.allow always`) + + os.Setenv(GIT_CONFIG_GLOBAL_ENV_VAR, globalGitConfigPath(rootDir)) test.SetupRepo(shell) return nil } +func globalGitConfigPath(rootDir string) string { + return filepath.Join(rootDir, "test", "global_git_config") +} + func getLazygitCommand(test *IntegrationTest, paths Paths, rootDir string, sandbox bool, keyPressDelay int) (*exec.Cmd, error) { osCommand := oscommands.NewDummyOSCommand() - templateConfigDir := filepath.Join(rootDir, "test", "default_test_config") - err := os.RemoveAll(paths.Config()) if err != nil { return nil, err } + + templateConfigDir := filepath.Join(rootDir, "test", "default_test_config") err = oscommands.CopyDir(templateConfigDir, paths.Config()) if err != nil { return nil, err @@ -165,7 +169,7 @@ func getLazygitCommand(test *IntegrationTest, paths Paths, rootDir string, sandb cmdObj.AddEnvVars(fmt.Sprintf("KEY_PRESS_DELAY=%d", keyPressDelay)) } - cmdObj.AddEnvVars("GIT_CONFIG_GLOBAL=/dev/null") + cmdObj.AddEnvVars(fmt.Sprintf("%s=%s", GIT_CONFIG_GLOBAL_ENV_VAR, globalGitConfigPath(rootDir))) return cmdObj.GetCmd(), nil } diff --git a/test/global_git_config b/test/global_git_config new file mode 100644 index 000000000..bfd11875c --- /dev/null +++ b/test/global_git_config @@ -0,0 +1,8 @@ +[user] + name = CI + email = CI@example.com +[protocol "file"] + # see https://vielmetti.typepad.com/logbook/2022/10/git-security-fixes-lead-to-fatal-transport-file-not-allowed-error-in-ci-systems-cve-2022-39253.html + allow = always +[commit] + gpgSign = false From d7956c481d51fbb6820e0e4419c87427bbfd12bb Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 12 Feb 2023 17:40:53 +1100 Subject: [PATCH 5/6] migrate submodule enter test --- pkg/integration/components/matcher.go | 2 +- pkg/integration/tests/submodule/enter.go | 69 ++++++++++++++++++ pkg/integration/tests/tests.go | 1 + .../submoduleEnter/expected/other_repo/HEAD | 1 - .../submoduleEnter/expected/other_repo/config | 8 -- .../expected/other_repo/description | 1 - .../expected/other_repo/info/exclude | 7 -- .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../42/530e986dbb65877ed8d61ca0c816e425e5c62e | Bin 150 -> 0 bytes .../96/c588f28aac5a8ebd6430526697e82e46b3180c | Bin 83 -> 0 bytes .../a5/0a5125768001a3ea263ffb7cafbc421a508153 | 2 - .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../a7/341a59f0ddeef969e69fb6368266d22b0f2416 | Bin 77 -> 0 bytes .../fc/4712e93d74ad4fb68e2fd219ac253ae03e19a4 | 2 - .../expected/other_repo/packed-refs | 2 - .../expected/repo/.git_keep/COMMIT_EDITMSG | 1 - .../expected/repo/.git_keep/FETCH_HEAD | 0 .../expected/repo/.git_keep/HEAD | 1 - .../expected/repo/.git_keep/config | 13 ---- .../expected/repo/.git_keep/description | 1 - .../expected/repo/.git_keep/index | Bin 441 -> 0 bytes .../expected/repo/.git_keep/info/exclude | 7 -- .../expected/repo/.git_keep/logs/HEAD | 5 -- .../repo/.git_keep/logs/refs/heads/master | 5 -- .../repo/.git_keep/modules/other_repo/HEAD | 1 - .../.git_keep/modules/other_repo/ORIG_HEAD | 1 - .../repo/.git_keep/modules/other_repo/config | 14 ---- .../.git_keep/modules/other_repo/description | 1 - .../repo/.git_keep/modules/other_repo/index | Bin 137 -> 0 bytes .../.git_keep/modules/other_repo/info/exclude | 7 -- .../.git_keep/modules/other_repo/logs/HEAD | 5 -- .../modules/other_repo/logs/refs/heads/master | 3 - .../other_repo/logs/refs/remotes/origin/HEAD | 1 - .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../42/530e986dbb65877ed8d61ca0c816e425e5c62e | Bin 150 -> 0 bytes .../96/c588f28aac5a8ebd6430526697e82e46b3180c | Bin 83 -> 0 bytes .../a5/0a5125768001a3ea263ffb7cafbc421a508153 | 2 - .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../a7/341a59f0ddeef969e69fb6368266d22b0f2416 | Bin 77 -> 0 bytes .../fc/4712e93d74ad4fb68e2fd219ac253ae03e19a4 | 2 - .../.git_keep/modules/other_repo/packed-refs | 2 - .../modules/other_repo/refs/heads/master | 1 - .../other_repo/refs/remotes/origin/HEAD | 1 - .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../10/7f435787895be1068f01326df55c355a9d29b1 | Bin 154 -> 0 bytes .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../2b/864257bf2d49adbad8785540d85030a60852ff | Bin 62 -> 0 bytes .../42/530e986dbb65877ed8d61ca0c816e425e5c62e | Bin 150 -> 0 bytes .../59/a9aee220657762e2d1c60799a0f5b03137d906 | Bin 155 -> 0 bytes .../96/c588f28aac5a8ebd6430526697e82e46b3180c | Bin 83 -> 0 bytes .../a5/0a5125768001a3ea263ffb7cafbc421a508153 | 2 - .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../a7/341a59f0ddeef969e69fb6368266d22b0f2416 | Bin 77 -> 0 bytes .../e1/eb418c0ff98940d4ea817eebcff5dcdde645ce | 4 - .../fc/4712e93d74ad4fb68e2fd219ac253ae03e19a4 | 2 - .../fd/65a5c96edfc884a78bfe3d0240cb8a7ea0a31a | 4 - .../expected/repo/.git_keep/refs/heads/master | 1 - .../expected/repo/.gitmodules_keep | 3 - .../submoduleEnter/expected/repo/myfile1 | 1 - .../submoduleEnter/expected/repo/myfile2 | 1 - .../submoduleEnter/expected/repo/myfile3 | 1 - .../expected/repo/other_repo/.git_keep | 1 - .../expected/repo/other_repo/myfile1 | 1 - .../integration/submoduleEnter/recording.json | 1 - test/integration/submoduleEnter/setup.sh | 30 -------- test/integration/submoduleEnter/test.json | 4 - 68 files changed, 71 insertions(+), 154 deletions(-) create mode 100644 pkg/integration/tests/submodule/enter.go delete mode 100644 test/integration/submoduleEnter/expected/other_repo/HEAD delete mode 100644 test/integration/submoduleEnter/expected/other_repo/config delete mode 100644 test/integration/submoduleEnter/expected/other_repo/description delete mode 100644 test/integration/submoduleEnter/expected/other_repo/info/exclude delete mode 100644 test/integration/submoduleEnter/expected/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/submoduleEnter/expected/other_repo/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/submoduleEnter/expected/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e delete mode 100644 test/integration/submoduleEnter/expected/other_repo/objects/96/c588f28aac5a8ebd6430526697e82e46b3180c delete mode 100644 test/integration/submoduleEnter/expected/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 delete mode 100644 test/integration/submoduleEnter/expected/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/submoduleEnter/expected/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 delete mode 100644 test/integration/submoduleEnter/expected/other_repo/objects/fc/4712e93d74ad4fb68e2fd219ac253ae03e19a4 delete mode 100644 test/integration/submoduleEnter/expected/other_repo/packed-refs delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/COMMIT_EDITMSG delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/FETCH_HEAD delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/HEAD delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/config delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/description delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/index delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/info/exclude delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/logs/HEAD delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/logs/refs/heads/master delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/HEAD delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/ORIG_HEAD delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/config delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/description delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/index delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/info/exclude delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/logs/HEAD delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/logs/refs/heads/master delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/logs/refs/remotes/origin/HEAD delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/96/c588f28aac5a8ebd6430526697e82e46b3180c delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/fc/4712e93d74ad4fb68e2fd219ac253ae03e19a4 delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/packed-refs delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/refs/heads/master delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/refs/remotes/origin/HEAD delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/objects/10/7f435787895be1068f01326df55c355a9d29b1 delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/objects/59/a9aee220657762e2d1c60799a0f5b03137d906 delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/objects/96/c588f28aac5a8ebd6430526697e82e46b3180c delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/objects/e1/eb418c0ff98940d4ea817eebcff5dcdde645ce delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/objects/fc/4712e93d74ad4fb68e2fd219ac253ae03e19a4 delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/objects/fd/65a5c96edfc884a78bfe3d0240cb8a7ea0a31a delete mode 100644 test/integration/submoduleEnter/expected/repo/.git_keep/refs/heads/master delete mode 100644 test/integration/submoduleEnter/expected/repo/.gitmodules_keep delete mode 100644 test/integration/submoduleEnter/expected/repo/myfile1 delete mode 100644 test/integration/submoduleEnter/expected/repo/myfile2 delete mode 100644 test/integration/submoduleEnter/expected/repo/myfile3 delete mode 100644 test/integration/submoduleEnter/expected/repo/other_repo/.git_keep delete mode 100644 test/integration/submoduleEnter/expected/repo/other_repo/myfile1 delete mode 100644 test/integration/submoduleEnter/recording.json delete mode 100644 test/integration/submoduleEnter/setup.sh delete mode 100644 test/integration/submoduleEnter/test.json diff --git a/pkg/integration/components/matcher.go b/pkg/integration/components/matcher.go index 0bbb1109b..85a26bbde 100644 --- a/pkg/integration/components/matcher.go +++ b/pkg/integration/components/matcher.go @@ -83,7 +83,7 @@ func (self *matcher) MatchesRegexp(target string) *matcher { if err != nil { return false, fmt.Sprintf("Unexpected error parsing regular expression '%s': %s", target, err.Error()) } - return matched, fmt.Sprintf("Expected '%s' to match regular expression '%s'", value, target) + return matched, fmt.Sprintf("Expected '%s' to match regular expression /%s/", value, target) }, }) } diff --git a/pkg/integration/tests/submodule/enter.go b/pkg/integration/tests/submodule/enter.go new file mode 100644 index 000000000..c97e55a46 --- /dev/null +++ b/pkg/integration/tests/submodule/enter.go @@ -0,0 +1,69 @@ +package submodule + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var Enter = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Enter a submodule, add a commit, and then stage the change in the parent repo", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(cfg *config.AppConfig) { + cfg.UserConfig.CustomCommands = []config.CustomCommand{ + { + Key: "e", + Context: "files", + Command: "git commit --allow-empty -m \"empty commit\"", + }, + } + }, + SetupRepo: func(shell *Shell) { + shell.EmptyCommit("first commit") + shell.RunCommand("git clone --bare . ../other_repo") + shell.RunCommand("git submodule add ../other_repo my_submodule") + shell.GitAddAll() + shell.Commit("add submodule") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Submodules().Focus(). + Lines( + Contains("my_submodule").IsSelected(), + ). + // enter the submodule + PressEnter() + + t.Views().Files().IsFocused(). + Press("e"). + Tap(func() { + t.Views().Commits().Content(Contains("empty commit")) + }). + // return to the parent repo + PressEscape() + + t.Views().Submodules().IsFocused() + + // we see the new commit in the submodule is ready to be staged in the parent repo + t.Views().Main().Content(Contains("> empty commit")) + + t.Views().Files().Focus(). + Lines( + MatchesRegexp(` M.*my_submodule \(submodule\)`).IsSelected(), + ). + Tap(func() { + // main view also shows the new commit when we're looking at the submodule within the files view + t.Views().Main().Content(Contains("> empty commit")) + }). + PressPrimaryAction(). + Press(keys.Files.CommitChanges). + Tap(func() { + t.ExpectPopup().CommitMessagePanel().Type("submodule change").Confirm() + }). + IsEmpty() + + t.Views().Submodules().Focus() + + // we no longer report a new commit because we've committed it in the parent repo + t.Views().Main().Content(DoesNotContain("> empty commit")) + }, +}) diff --git a/pkg/integration/tests/tests.go b/pkg/integration/tests/tests.go index 79bb5a84c..b7e74114c 100644 --- a/pkg/integration/tests/tests.go +++ b/pkg/integration/tests/tests.go @@ -78,6 +78,7 @@ var tests = []*components.IntegrationTest{ patch_building.BuildPatchAndCopyToClipboard, submodule.Add, submodule.Remove, + submodule.Enter, } func GetTests() []*components.IntegrationTest { diff --git a/test/integration/submoduleEnter/expected/other_repo/HEAD b/test/integration/submoduleEnter/expected/other_repo/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/submoduleEnter/expected/other_repo/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/submoduleEnter/expected/other_repo/config b/test/integration/submoduleEnter/expected/other_repo/config deleted file mode 100644 index f3148fc2f..000000000 --- a/test/integration/submoduleEnter/expected/other_repo/config +++ /dev/null @@ -1,8 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = true - ignorecase = true - precomposeunicode = true -[remote "origin"] - url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleEnter/actual/./repo diff --git a/test/integration/submoduleEnter/expected/other_repo/description b/test/integration/submoduleEnter/expected/other_repo/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/submoduleEnter/expected/other_repo/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleEnter/expected/other_repo/info/exclude b/test/integration/submoduleEnter/expected/other_repo/info/exclude deleted file mode 100644 index 8e9f2071f..000000000 --- a/test/integration/submoduleEnter/expected/other_repo/info/exclude +++ /dev/null @@ -1,7 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ -.DS_Store diff --git a/test/integration/submoduleEnter/expected/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleEnter/expected/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmb~ZE#08nZNMgRZ+ diff --git a/test/integration/submoduleEnter/expected/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleEnter/expected/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e deleted file mode 100644 index 64d20cb1ea175608a3e05acff298a97ed57eb7b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 150 zcmV;H0BQet0gaA93c@fDMP26<*$Xn6B$Eb2gsyswNjrlDV@rvkw>L*{``_d7=dISY zS(n499U_*K4~}D2SQZh@l!dYu@-!gPf>=N?I5ImQ@@keNaC8_G4FHb4Fp^g-X=W{R zz}|wvMQ`}s9@}BZ$zI3lE+4M@Q!evXZ?@x*GNzdA861G=Yd_WGPu7Fl8__FfcPQQOK=K%gjkNWLUcA@n6-{8($(qqj>V2E(CbB pbYDeLV#FZ9^TVh?Y2Ue*s}_Y<^|!pzo^PR!qQn@h5&(QbEOn@fC6WLD diff --git a/test/integration/submoduleEnter/expected/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 b/test/integration/submoduleEnter/expected/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 deleted file mode 100644 index 5dd5f3236..000000000 --- a/test/integration/submoduleEnter/expected/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 +++ /dev/null @@ -1,2 +0,0 @@ -xM -0@sJ&N  I޾/ZHR%d"r@X<-4dG5?fxN(_& 6]פ˟\ճ5, \ No newline at end of file diff --git a/test/integration/submoduleEnter/expected/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/submoduleEnter/expected/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 deleted file mode 100644 index 285df3e5fbab12262e28d85e78af8a31cd0024c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb`~^A08nuUMF0Q* diff --git a/test/integration/submoduleEnter/expected/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleEnter/expected/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 deleted file mode 100644 index 96d2e71a6af75cdd27ac5d9628a27faecc40fb66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77 zcmV-T0J8sh0V^p=O;s>AU@$Z=Ff%bx$gNDv%tB=N-?^8o7KK;!x4hDxZ=ntVWIZ01*pecg diff --git a/test/integration/submoduleEnter/expected/other_repo/objects/fc/4712e93d74ad4fb68e2fd219ac253ae03e19a4 b/test/integration/submoduleEnter/expected/other_repo/objects/fc/4712e93d74ad4fb68e2fd219ac253ae03e19a4 deleted file mode 100644 index 95d1a3bc9..000000000 --- a/test/integration/submoduleEnter/expected/other_repo/objects/fc/4712e93d74ad4fb68e2fd219ac253ae03e19a4 +++ /dev/null @@ -1,2 +0,0 @@ -xK -0@] L&PDH&S,4z{{㭵k¥":!(gLR*o!($` =:8Fa-bJ-gdQN-Dwn'=C>xkwm\NzNu3W;/x9 \ No newline at end of file diff --git a/test/integration/submoduleEnter/expected/other_repo/packed-refs b/test/integration/submoduleEnter/expected/other_repo/packed-refs deleted file mode 100644 index 83e031563..000000000 --- a/test/integration/submoduleEnter/expected/other_repo/packed-refs +++ /dev/null @@ -1,2 +0,0 @@ -# pack-refs with: peeled fully-peeled sorted -fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 refs/heads/master diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/submoduleEnter/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 9daeafb98..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/FETCH_HEAD b/test/integration/submoduleEnter/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/HEAD b/test/integration/submoduleEnter/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/config b/test/integration/submoduleEnter/expected/repo/.git_keep/config deleted file mode 100644 index 053d8f942..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/config +++ /dev/null @@ -1,13 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true -[user] - email = CI@example.com - name = CI -[submodule "other_repo"] - url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleEnter/actual/other_repo - active = true diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/description b/test/integration/submoduleEnter/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/index b/test/integration/submoduleEnter/expected/repo/.git_keep/index deleted file mode 100644 index 0b75986af620806f92912a6f6fd0eb6bf77ddfcf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 441 zcmZ?q402{*U|<4b)+GDWHReHj3&C{2+*n4S7}MN0lNlHqmoP9eeg&!#0b)n(HmC6Y zx}Ixy-KYq4xDjBmj3ekj1Gip!W=U>-N@-4NF;Ec*fXvY_p1T7^L(F@98_hhnrF$O# zRZYF|B_cG6C*SEpfLBZRRR;Fl%CyX!R70pantUOzLFRyHs5u|e&5_{wVbq|s@7&8( zi^8k=TV83;w@`_ zP!=9e4NJKKRm&O}7r#=o|6Q|wkCRkDV=x0(eo01ZQG8KqK|WA17=#450`)RTGMFkD va0%2qhqre|KV<7?G|K%NV;VJAb7SHx?;fER@u!?Kx@~g 1534792759 +0100 commit (initial): myfile1 -a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 -42530e986dbb65877ed8d61ca0c816e425e5c62e fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 CI 1534792759 +0100 commit: myfile3 -fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 e1eb418c0ff98940d4ea817eebcff5dcdde645ce CI 1534792759 +0100 commit: add submodule -e1eb418c0ff98940d4ea817eebcff5dcdde645ce fd65a5c96edfc884a78bfe3d0240cb8a7ea0a31a CI 1648348036 +1100 commit: test diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/submoduleEnter/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index bcb2bf2e8..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1,5 +0,0 @@ -0000000000000000000000000000000000000000 a50a5125768001a3ea263ffb7cafbc421a508153 CI 1534792759 +0100 commit (initial): myfile1 -a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 -42530e986dbb65877ed8d61ca0c816e425e5c62e fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 CI 1534792759 +0100 commit: myfile3 -fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 e1eb418c0ff98940d4ea817eebcff5dcdde645ce CI 1534792759 +0100 commit: add submodule -e1eb418c0ff98940d4ea817eebcff5dcdde645ce fd65a5c96edfc884a78bfe3d0240cb8a7ea0a31a CI 1648348036 +1100 commit: test diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/HEAD b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/ORIG_HEAD b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/ORIG_HEAD deleted file mode 100644 index a70ff80c0..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -42530e986dbb65877ed8d61ca0c816e425e5c62e diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/config b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/config deleted file mode 100644 index d14d72ba1..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/config +++ /dev/null @@ -1,14 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true - worktree = ../../../other_repo -[remote "origin"] - url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleEnter/actual/other_repo - fetch = +refs/heads/*:refs/remotes/origin/* -[branch "master"] - remote = origin - merge = refs/heads/master diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/description b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/index b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/index deleted file mode 100644 index 304e778445bc17a204d162150a0d8220bb5be4ef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 137 zcmZ?q402{*U|<4b#w7dGHD90UFB0$WxbkF0zs;M`= zM1)51J8x{9}ltV=n+)OEIkg diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/info/exclude b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/info/exclude deleted file mode 100644 index 8e9f2071f..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/info/exclude +++ /dev/null @@ -1,7 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ -.DS_Store diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/logs/HEAD b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/logs/HEAD deleted file mode 100644 index ed71cbd0f..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/logs/HEAD +++ /dev/null @@ -1,5 +0,0 @@ -0000000000000000000000000000000000000000 fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 Jesse Duffield 1534792759 +0100 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleEnter/actual/other_repo -fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1648348031 +1100 rebase -i (start): checkout 42530e986dbb65877ed8d61ca0c816e425e5c62e -42530e986dbb65877ed8d61ca0c816e425e5c62e 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1648348031 +1100 rebase -i (finish): returning to refs/heads/master -42530e986dbb65877ed8d61ca0c816e425e5c62e a50a5125768001a3ea263ffb7cafbc421a508153 Jesse Duffield 1648348032 +1100 rebase -i (start): checkout a50a5125768001a3ea263ffb7cafbc421a508153 -a50a5125768001a3ea263ffb7cafbc421a508153 a50a5125768001a3ea263ffb7cafbc421a508153 Jesse Duffield 1648348032 +1100 rebase -i (finish): returning to refs/heads/master diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/logs/refs/heads/master b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/logs/refs/heads/master deleted file mode 100644 index 36662576a..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/logs/refs/heads/master +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 Jesse Duffield 1534792759 +0100 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleEnter/actual/other_repo -fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1648348031 +1100 rebase -i (finish): refs/heads/master onto 42530e986dbb65877ed8d61ca0c816e425e5c62e -42530e986dbb65877ed8d61ca0c816e425e5c62e a50a5125768001a3ea263ffb7cafbc421a508153 Jesse Duffield 1648348032 +1100 rebase -i (finish): refs/heads/master onto a50a5125768001a3ea263ffb7cafbc421a508153 diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/logs/refs/remotes/origin/HEAD b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/logs/refs/remotes/origin/HEAD deleted file mode 100644 index 259f2e9f2..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/logs/refs/remotes/origin/HEAD +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 Jesse Duffield 1534792759 +0100 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleEnter/actual/other_repo diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmb~ZE#08nZNMgRZ+ diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e deleted file mode 100644 index 64d20cb1ea175608a3e05acff298a97ed57eb7b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 150 zcmV;H0BQet0gaA93c@fDMP26<*$Xn6B$Eb2gsyswNjrlDV@rvkw>L*{``_d7=dISY zS(n499U_*K4~}D2SQZh@l!dYu@-!gPf>=N?I5ImQ@@keNaC8_G4FHb4Fp^g-X=W{R zz}|wvMQ`}s9@}BZ$zI3lE+4M@Q!evXZ?@x*GNzdA861G=Yd_WGPu7Fl8__FfcPQQOK=K%gjkNWLUcA@n6-{8($(qqj>V2E(CbB pbYDeLV#FZ9^TVh?Y2Ue*s}_Y<^|!pzo^PR!qQn@h5&(QbEOn@fC6WLD diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 deleted file mode 100644 index 5dd5f3236..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 +++ /dev/null @@ -1,2 +0,0 @@ -xM -0@sJ&N  I޾/ZHR%d"r@X<-4dG5?fxN(_& 6]פ˟\ճ5, \ No newline at end of file diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 deleted file mode 100644 index 285df3e5fbab12262e28d85e78af8a31cd0024c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb`~^A08nuUMF0Q* diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 deleted file mode 100644 index 96d2e71a6af75cdd27ac5d9628a27faecc40fb66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77 zcmV-T0J8sh0V^p=O;s>AU@$Z=Ff%bx$gNDv%tB=N-?^8o7KK;!x4hDxZ=ntVWIZ01*pecg diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/fc/4712e93d74ad4fb68e2fd219ac253ae03e19a4 b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/fc/4712e93d74ad4fb68e2fd219ac253ae03e19a4 deleted file mode 100644 index 95d1a3bc9..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/objects/fc/4712e93d74ad4fb68e2fd219ac253ae03e19a4 +++ /dev/null @@ -1,2 +0,0 @@ -xK -0@] L&PDH&S,4z{{㭵k¥":!(gLR*o!($` =:8Fa-bJ-gdQN-Dwn'=C>xkwm\NzNu3W;/x9 \ No newline at end of file diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/packed-refs b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/packed-refs deleted file mode 100644 index ef4e386a6..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/packed-refs +++ /dev/null @@ -1,2 +0,0 @@ -# pack-refs with: peeled fully-peeled sorted -fc4712e93d74ad4fb68e2fd219ac253ae03e19a4 refs/remotes/origin/master diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/refs/heads/master b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/refs/heads/master deleted file mode 100644 index ab99dc85b..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -a50a5125768001a3ea263ffb7cafbc421a508153 diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/refs/remotes/origin/HEAD b/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/refs/remotes/origin/HEAD deleted file mode 100644 index 6efe28fff..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/modules/other_repo/refs/remotes/origin/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/remotes/origin/master diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleEnter/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmbGp0V^p=O;s?oFk&z?FfcPQQP4}zEXmDJDa}bOX3%bP3g55mxpvo$icp6e z0S3!Bg8oC5VvJphnE?~ZE#08nZNMgRZ+ diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff b/test/integration/submoduleEnter/expected/repo/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff deleted file mode 100644 index 5bfb0cefc3370964e04c1d101231d7a71600af5a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 62 zcmV-E0Kxxw0ZYosPf{>5Wr!{=P0GzrDa}b$P|7dKNG*ylN-fA&isj-gNG!=vuvI_^ Ua&eXxL*{``_d7=dISY zS(n499U_*K4~}D2SQZh@l!dYu@-!gPf>=N?I5ImQ@@keNaC8_G4FHb4Fp^g-X=W{R zz}|wvMQ`}s9@}BZ$zI3lE+4M@Q!evXZ?@x*GNzdA861G=Yd_WGPuVvJphnE?7Fl8__FfcPQQOK=K%gjkNWLUcA@n6-{8($(qqj>V2E(CbB pbYDeLV#FZ9^TVh?Y2Ue*s}_Y<^|!pzo^PR!qQn@h5&(QbEOn@fC6WLD diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 b/test/integration/submoduleEnter/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 deleted file mode 100644 index 5dd5f3236..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 +++ /dev/null @@ -1,2 +0,0 @@ -xM -0@sJ&N  I޾/ZHR%d"r@X<-4dG5?fxN(_& 6]פ˟\ճ5, \ No newline at end of file diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/submoduleEnter/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 deleted file mode 100644 index 285df3e5fbab12262e28d85e78af8a31cd0024c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb`~^A08nuUMF0Q* diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleEnter/expected/repo/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 deleted file mode 100644 index 96d2e71a6af75cdd27ac5d9628a27faecc40fb66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77 zcmV-T0J8sh0V^p=O;s>AU@$Z=Ff%bx$gNDv%tB=N-?^8o7KK;!x4hDxZ=ntVWIZ01*pecg diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/objects/e1/eb418c0ff98940d4ea817eebcff5dcdde645ce b/test/integration/submoduleEnter/expected/repo/.git_keep/objects/e1/eb418c0ff98940d4ea817eebcff5dcdde645ce deleted file mode 100644 index 9a2e552b8..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/objects/e1/eb418c0ff98940d4ea817eebcff5dcdde645ce +++ /dev/null @@ -1,4 +0,0 @@ -xK -0@]d29 "tcL --5ox^7U,,DCJ` :RafMjɒ+KuWZȲd -Nl0pƇ~^`)3ZDsc럹ROm)xkwm\NzNu3W;/x9 \ No newline at end of file diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/objects/fd/65a5c96edfc884a78bfe3d0240cb8a7ea0a31a b/test/integration/submoduleEnter/expected/repo/.git_keep/objects/fd/65a5c96edfc884a78bfe3d0240cb8a7ea0a31a deleted file mode 100644 index f431c893b..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/objects/fd/65a5c96edfc884a78bfe3d0240cb8a7ea0a31a +++ /dev/null @@ -1,4 +0,0 @@ -xM -1 @a=E$ӦMADp5Ou1w-^]xńD,BQȉ n -UGSRAM^jx -'NEJZmM*&l6m7)yuR$99 \ No newline at end of file diff --git a/test/integration/submoduleEnter/expected/repo/.git_keep/refs/heads/master b/test/integration/submoduleEnter/expected/repo/.git_keep/refs/heads/master deleted file mode 100644 index 35e1a490a..000000000 --- a/test/integration/submoduleEnter/expected/repo/.git_keep/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -fd65a5c96edfc884a78bfe3d0240cb8a7ea0a31a diff --git a/test/integration/submoduleEnter/expected/repo/.gitmodules_keep b/test/integration/submoduleEnter/expected/repo/.gitmodules_keep deleted file mode 100644 index 2b864257b..000000000 --- a/test/integration/submoduleEnter/expected/repo/.gitmodules_keep +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "other_repo"] - path = other_repo - url = ../other_repo diff --git a/test/integration/submoduleEnter/expected/repo/myfile1 b/test/integration/submoduleEnter/expected/repo/myfile1 deleted file mode 100644 index a5bce3fd2..000000000 --- a/test/integration/submoduleEnter/expected/repo/myfile1 +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/test/integration/submoduleEnter/expected/repo/myfile2 b/test/integration/submoduleEnter/expected/repo/myfile2 deleted file mode 100644 index 180cf8328..000000000 --- a/test/integration/submoduleEnter/expected/repo/myfile2 +++ /dev/null @@ -1 +0,0 @@ -test2 diff --git a/test/integration/submoduleEnter/expected/repo/myfile3 b/test/integration/submoduleEnter/expected/repo/myfile3 deleted file mode 100644 index 180cf8328..000000000 --- a/test/integration/submoduleEnter/expected/repo/myfile3 +++ /dev/null @@ -1 +0,0 @@ -test2 diff --git a/test/integration/submoduleEnter/expected/repo/other_repo/.git_keep b/test/integration/submoduleEnter/expected/repo/other_repo/.git_keep deleted file mode 100644 index 32e5ae2e6..000000000 --- a/test/integration/submoduleEnter/expected/repo/other_repo/.git_keep +++ /dev/null @@ -1 +0,0 @@ -gitdir: ../.git/modules/other_repo diff --git a/test/integration/submoduleEnter/expected/repo/other_repo/myfile1 b/test/integration/submoduleEnter/expected/repo/other_repo/myfile1 deleted file mode 100644 index a5bce3fd2..000000000 --- a/test/integration/submoduleEnter/expected/repo/other_repo/myfile1 +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/test/integration/submoduleEnter/recording.json b/test/integration/submoduleEnter/recording.json deleted file mode 100644 index 568b008b0..000000000 --- a/test/integration/submoduleEnter/recording.json +++ /dev/null @@ -1 +0,0 @@ -{"KeyEvents":[{"Timestamp":737,"Mod":0,"Key":256,"Ch":93},{"Timestamp":1306,"Mod":0,"Key":13,"Ch":13},{"Timestamp":1937,"Mod":0,"Key":259,"Ch":0},{"Timestamp":2162,"Mod":0,"Key":259,"Ch":0},{"Timestamp":2462,"Mod":0,"Key":256,"Ch":100},{"Timestamp":2687,"Mod":0,"Key":13,"Ch":13},{"Timestamp":3049,"Mod":0,"Key":256,"Ch":100},{"Timestamp":3242,"Mod":0,"Key":13,"Ch":13},{"Timestamp":3862,"Mod":0,"Key":27,"Ch":0},{"Timestamp":5177,"Mod":0,"Key":256,"Ch":91},{"Timestamp":6272,"Mod":0,"Key":256,"Ch":32},{"Timestamp":6752,"Mod":0,"Key":256,"Ch":99},{"Timestamp":7007,"Mod":0,"Key":256,"Ch":116},{"Timestamp":7051,"Mod":0,"Key":256,"Ch":101},{"Timestamp":7232,"Mod":0,"Key":256,"Ch":115},{"Timestamp":7276,"Mod":0,"Key":256,"Ch":116},{"Timestamp":7547,"Mod":0,"Key":13,"Ch":13},{"Timestamp":8251,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]} \ No newline at end of file diff --git a/test/integration/submoduleEnter/setup.sh b/test/integration/submoduleEnter/setup.sh deleted file mode 100644 index a38c6045b..000000000 --- a/test/integration/submoduleEnter/setup.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -set -e - -cd $1 - -export GIT_COMMITTER_DATE="Mon 20 Aug 2018 20:19:19 BST" -export GIT_AUTHOR_DATE="Mon 20 Aug 2018 20:19:19 BST" - -git init - -git config user.email "CI@example.com" -git config user.name "CI" - -echo test1 > myfile1 -git add . -git commit -am "myfile1" -echo test2 > myfile2 -git add . -git commit -am "myfile2" -echo test2 > myfile3 -git add . -git commit -am "myfile3" - -cd .. -git clone --bare ./repo other_repo -cd repo - -git -c protocol.file.allow=always submodule add ../other_repo -git commit -am "add submodule" diff --git a/test/integration/submoduleEnter/test.json b/test/integration/submoduleEnter/test.json deleted file mode 100644 index 7bc6ff8ba..000000000 --- a/test/integration/submoduleEnter/test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "description": "Add submodule and enter. We enter the submodule, remove a couple of commits, and then stage the change in the parent repo", - "speed": 5 -} From 3cfdae41165828f9ecb3f3497efd37651a6193d3 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 12 Feb 2023 18:00:45 +1100 Subject: [PATCH 6/6] migrate submodule reset test --- pkg/integration/tests/submodule/enter.go | 13 +++ pkg/integration/tests/submodule/reset.go | 105 ++++++++++++++++++ pkg/integration/tests/tests.go | 1 + .../submoduleReset/config/config.yml | 6 - .../submoduleReset/expected/other_repo/HEAD | 1 - .../submoduleReset/expected/other_repo/config | 8 -- .../expected/other_repo/description | 1 - .../expected/other_repo/info/exclude | 7 -- .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../42/530e986dbb65877ed8d61ca0c816e425e5c62e | Bin 150 -> 0 bytes .../a5/0a5125768001a3ea263ffb7cafbc421a508153 | 2 - .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../a7/341a59f0ddeef969e69fb6368266d22b0f2416 | Bin 77 -> 0 bytes .../expected/other_repo/packed-refs | 2 - .../expected/repo/.git_keep/COMMIT_EDITMSG | 1 - .../expected/repo/.git_keep/FETCH_HEAD | 0 .../expected/repo/.git_keep/HEAD | 1 - .../expected/repo/.git_keep/config | 13 --- .../expected/repo/.git_keep/description | 1 - .../expected/repo/.git_keep/index | Bin 369 -> 0 bytes .../expected/repo/.git_keep/info/exclude | 7 -- .../expected/repo/.git_keep/logs/HEAD | 3 - .../repo/.git_keep/logs/refs/heads/master | 3 - .../repo/.git_keep/modules/other_repo/HEAD | 1 - .../.git_keep/modules/other_repo/ORIG_HEAD | 1 - .../repo/.git_keep/modules/other_repo/config | 14 --- .../.git_keep/modules/other_repo/description | 1 - .../repo/.git_keep/modules/other_repo/index | Bin 209 -> 0 bytes .../.git_keep/modules/other_repo/info/exclude | 7 -- .../.git_keep/modules/other_repo/logs/HEAD | 5 - .../modules/other_repo/logs/refs/heads/master | 2 - .../other_repo/logs/refs/remotes/origin/HEAD | 1 - .../modules/other_repo/logs/refs/stash | 1 - .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../17/a177705e91137f8c55965c9c8818dd55e97c89 | 2 - .../17/defcd0e1f9ad96542aa66845e53cb46c91c30d | Bin 86 -> 0 bytes .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../42/530e986dbb65877ed8d61ca0c816e425e5c62e | Bin 150 -> 0 bytes .../4b/825dc642cb6eb9a060e54bf8d69288fbee4904 | Bin 15 -> 0 bytes .../5a/d28e22767f979da2c198dc6c1003b25964e3da | Bin 20 -> 0 bytes .../87/4e570cb4ea7387ba59054b315aa584038cacea | 2 - .../a5/0a5125768001a3ea263ffb7cafbc421a508153 | 2 - .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../a7/341a59f0ddeef969e69fb6368266d22b0f2416 | Bin 77 -> 0 bytes .../d2/2afbf8d80bbd74bcd87cae8a17a0315cfc915b | Bin 180 -> 0 bytes .../.git_keep/modules/other_repo/packed-refs | 2 - .../modules/other_repo/refs/heads/master | 1 - .../other_repo/refs/remotes/origin/HEAD | 1 - .../.git_keep/modules/other_repo/refs/stash | 1 - .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../2b/864257bf2d49adbad8785540d85030a60852ff | Bin 62 -> 0 bytes .../2e/eb2c1e6451d1318b506eecddf936b59a5f32b8 | Bin 150 -> 0 bytes .../42/530e986dbb65877ed8d61ca0c816e425e5c62e | Bin 150 -> 0 bytes .../9d/10a5a0a21eb2cfdb6206f474ed57fd5cd51440 | Bin 152 -> 0 bytes .../a5/0a5125768001a3ea263ffb7cafbc421a508153 | 2 - .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../a7/341a59f0ddeef969e69fb6368266d22b0f2416 | Bin 77 -> 0 bytes .../expected/repo/.git_keep/refs/heads/master | 1 - .../expected/repo/.gitmodules_keep | 3 - .../submoduleReset/expected/repo/myfile1 | 1 - .../submoduleReset/expected/repo/myfile2 | 1 - .../expected/repo/other_repo/.git_keep | 1 - .../expected/repo/other_repo/myfile1 | 1 - .../expected/repo/other_repo/myfile2 | 1 - .../integration/submoduleReset/recording.json | 1 - test/integration/submoduleReset/setup.sh | 27 ----- test/integration/submoduleReset/test.json | 4 - 69 files changed, 119 insertions(+), 143 deletions(-) create mode 100644 pkg/integration/tests/submodule/reset.go delete mode 100644 test/integration/submoduleReset/config/config.yml delete mode 100644 test/integration/submoduleReset/expected/other_repo/HEAD delete mode 100644 test/integration/submoduleReset/expected/other_repo/config delete mode 100644 test/integration/submoduleReset/expected/other_repo/description delete mode 100644 test/integration/submoduleReset/expected/other_repo/info/exclude delete mode 100644 test/integration/submoduleReset/expected/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/submoduleReset/expected/other_repo/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/submoduleReset/expected/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e delete mode 100644 test/integration/submoduleReset/expected/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 delete mode 100644 test/integration/submoduleReset/expected/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/submoduleReset/expected/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 delete mode 100644 test/integration/submoduleReset/expected/other_repo/packed-refs delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/COMMIT_EDITMSG delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/FETCH_HEAD delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/HEAD delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/config delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/description delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/index delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/info/exclude delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/logs/HEAD delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/logs/refs/heads/master delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/HEAD delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/ORIG_HEAD delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/config delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/description delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/index delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/info/exclude delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/logs/HEAD delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/logs/refs/heads/master delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/logs/refs/remotes/origin/HEAD delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/logs/refs/stash delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/17/a177705e91137f8c55965c9c8818dd55e97c89 delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/17/defcd0e1f9ad96542aa66845e53cb46c91c30d delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/5a/d28e22767f979da2c198dc6c1003b25964e3da delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/87/4e570cb4ea7387ba59054b315aa584038cacea delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/d2/2afbf8d80bbd74bcd87cae8a17a0315cfc915b delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/packed-refs delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/refs/heads/master delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/refs/remotes/origin/HEAD delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/refs/stash delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/objects/2e/eb2c1e6451d1318b506eecddf936b59a5f32b8 delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/objects/9d/10a5a0a21eb2cfdb6206f474ed57fd5cd51440 delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 delete mode 100644 test/integration/submoduleReset/expected/repo/.git_keep/refs/heads/master delete mode 100644 test/integration/submoduleReset/expected/repo/.gitmodules_keep delete mode 100644 test/integration/submoduleReset/expected/repo/myfile1 delete mode 100644 test/integration/submoduleReset/expected/repo/myfile2 delete mode 100644 test/integration/submoduleReset/expected/repo/other_repo/.git_keep delete mode 100644 test/integration/submoduleReset/expected/repo/other_repo/myfile1 delete mode 100644 test/integration/submoduleReset/expected/repo/other_repo/myfile2 delete mode 100644 test/integration/submoduleReset/recording.json delete mode 100644 test/integration/submoduleReset/setup.sh delete mode 100644 test/integration/submoduleReset/test.json diff --git a/pkg/integration/tests/submodule/enter.go b/pkg/integration/tests/submodule/enter.go index c97e55a46..8dbbb73b4 100644 --- a/pkg/integration/tests/submodule/enter.go +++ b/pkg/integration/tests/submodule/enter.go @@ -26,6 +26,15 @@ var Enter = NewIntegrationTest(NewIntegrationTestArgs{ shell.Commit("add submodule") }, Run: func(t *TestDriver, keys config.KeybindingConfig) { + assertInParentRepo := func() { + t.Views().Status().Content(Contains("repo")) + } + assertInSubmodule := func() { + t.Views().Status().Content(Contains("my_submodule")) + } + + assertInParentRepo() + t.Views().Submodules().Focus(). Lines( Contains("my_submodule").IsSelected(), @@ -33,6 +42,8 @@ var Enter = NewIntegrationTest(NewIntegrationTestArgs{ // enter the submodule PressEnter() + assertInSubmodule() + t.Views().Files().IsFocused(). Press("e"). Tap(func() { @@ -41,6 +52,8 @@ var Enter = NewIntegrationTest(NewIntegrationTestArgs{ // return to the parent repo PressEscape() + assertInParentRepo() + t.Views().Submodules().IsFocused() // we see the new commit in the submodule is ready to be staged in the parent repo diff --git a/pkg/integration/tests/submodule/reset.go b/pkg/integration/tests/submodule/reset.go new file mode 100644 index 000000000..474780f1b --- /dev/null +++ b/pkg/integration/tests/submodule/reset.go @@ -0,0 +1,105 @@ +package submodule + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var Reset = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Enter a submodule, create a commit and stage some changes, then reset the submodule from back in the parent repo. This test captures functionality around getting a dirty submodule out of your files panel.", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(cfg *config.AppConfig) { + cfg.UserConfig.CustomCommands = []config.CustomCommand{ + { + Key: "e", + Context: "files", + Command: "git commit --allow-empty -m \"empty commit\" && echo \"my_file content\" > my_file", + }, + } + }, + SetupRepo: func(shell *Shell) { + shell.EmptyCommit("first commit") + shell.RunCommand("git clone --bare . ../other_repo") + shell.RunCommand("git submodule add ../other_repo my_submodule") + shell.GitAddAll() + shell.Commit("add submodule") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + assertInParentRepo := func() { + t.Views().Status().Content(Contains("repo")) + } + assertInSubmodule := func() { + t.Views().Status().Content(Contains("my_submodule")) + } + + assertInParentRepo() + + t.Views().Submodules().Focus(). + Lines( + Contains("my_submodule").IsSelected(), + ). + // enter the submodule + PressEnter() + + assertInSubmodule() + + t.Views().Status().Content(Contains("my_submodule")) + + t.Views().Files().IsFocused(). + Press("e"). + Tap(func() { + t.Views().Commits().Content(Contains("empty commit")) + t.Views().Files().Content(Contains("my_file")) + }). + Lines( + Contains("my_file").IsSelected(), + ). + // stage my_file + PressPrimaryAction(). + // return to the parent repo + PressEscape() + + assertInParentRepo() + + t.Views().Submodules().IsFocused() + + t.Views().Main().Content(Contains("Submodule my_submodule contains modified content")) + + t.Views().Files().Focus(). + Lines( + MatchesRegexp(` M.*my_submodule \(submodule\)`).IsSelected(), + ). + Press(keys.Universal.Remove). + Tap(func() { + t.ExpectPopup().Menu().Title(Equals("my_submodule")).Select(Contains("stash uncommitted submodule changes and update")).Confirm() + }). + IsEmpty() + + t.Views().Submodules().Focus(). + PressEnter() + + assertInSubmodule() + + // submodule has been hard reset to the commit the parent repo specifies + t.Views().Branches().Lines( + Contains("HEAD detached").IsSelected(), + Contains("master"), + ) + + // empty commit is gone + t.Views().Commits().Lines( + Contains("first commit").IsSelected(), + ) + + // the staged change has been stashed + t.Views().Files().IsEmpty() + + t.Views().Stash().Focus(). + Lines( + Contains("WIP on master").IsSelected(), + ) + + t.Views().Main().Content(Contains("my_file content")) + }, +}) diff --git a/pkg/integration/tests/tests.go b/pkg/integration/tests/tests.go index b7e74114c..332d7e08f 100644 --- a/pkg/integration/tests/tests.go +++ b/pkg/integration/tests/tests.go @@ -79,6 +79,7 @@ var tests = []*components.IntegrationTest{ submodule.Add, submodule.Remove, submodule.Enter, + submodule.Reset, } func GetTests() []*components.IntegrationTest { diff --git a/test/integration/submoduleReset/config/config.yml b/test/integration/submoduleReset/config/config.yml deleted file mode 100644 index 991cda34b..000000000 --- a/test/integration/submoduleReset/config/config.yml +++ /dev/null @@ -1,6 +0,0 @@ -disableStartupPopups: true -customCommands: - - key: 'N' - description: 'Add file' - context: 'files' - command: 'echo "haha" > output.txt' diff --git a/test/integration/submoduleReset/expected/other_repo/HEAD b/test/integration/submoduleReset/expected/other_repo/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/submoduleReset/expected/other_repo/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/submoduleReset/expected/other_repo/config b/test/integration/submoduleReset/expected/other_repo/config deleted file mode 100644 index 662e16b6c..000000000 --- a/test/integration/submoduleReset/expected/other_repo/config +++ /dev/null @@ -1,8 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = true - ignorecase = true - precomposeunicode = true -[remote "origin"] - url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleReset/actual/./repo diff --git a/test/integration/submoduleReset/expected/other_repo/description b/test/integration/submoduleReset/expected/other_repo/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/submoduleReset/expected/other_repo/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleReset/expected/other_repo/info/exclude b/test/integration/submoduleReset/expected/other_repo/info/exclude deleted file mode 100644 index 8e9f2071f..000000000 --- a/test/integration/submoduleReset/expected/other_repo/info/exclude +++ /dev/null @@ -1,7 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ -.DS_Store diff --git a/test/integration/submoduleReset/expected/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleReset/expected/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmb~ZE#08nZNMgRZ+ diff --git a/test/integration/submoduleReset/expected/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleReset/expected/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e deleted file mode 100644 index 64d20cb1ea175608a3e05acff298a97ed57eb7b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 150 zcmV;H0BQet0gaA93c@fDMP26<*$Xn6B$Eb2gsyswNjrlDV@rvkw>L*{``_d7=dISY zS(n499U_*K4~}D2SQZh@l!dYu@-!gPf>=N?I5ImQ@@keNaC8_G4FHb4Fp^g-X=W{R zz}|wvMQ`}s9@}BZ$zI3lE+4M@Q!evXZ?@x*GNzdA861G=Yd_WGPu`~^A08nuUMF0Q* diff --git a/test/integration/submoduleReset/expected/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleReset/expected/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 deleted file mode 100644 index 96d2e71a6af75cdd27ac5d9628a27faecc40fb66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77 zcmV-T0J8sh0V^p=O;s>AU@$Z=Ff%bx$gNDv%tB=N-?^8o7KK;!x4hDxZ=ntVWIZ01*pecg diff --git a/test/integration/submoduleReset/expected/other_repo/packed-refs b/test/integration/submoduleReset/expected/other_repo/packed-refs deleted file mode 100644 index 62f6568b2..000000000 --- a/test/integration/submoduleReset/expected/other_repo/packed-refs +++ /dev/null @@ -1,2 +0,0 @@ -# pack-refs with: peeled fully-peeled sorted -42530e986dbb65877ed8d61ca0c816e425e5c62e refs/heads/master diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/submoduleReset/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index ad3cdfdd1..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -add submodule diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/FETCH_HEAD b/test/integration/submoduleReset/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/HEAD b/test/integration/submoduleReset/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/config b/test/integration/submoduleReset/expected/repo/.git_keep/config deleted file mode 100644 index ff4ef7e1c..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/config +++ /dev/null @@ -1,13 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true -[user] - email = CI@example.com - name = CI -[submodule "other_repo"] - url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleReset/actual/other_repo - active = true diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/description b/test/integration/submoduleReset/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/index b/test/integration/submoduleReset/expected/repo/.git_keep/index deleted file mode 100644 index 479039f965c9f3579255cef90af6c44864122ed8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 369 zcmZ?q402{*U|<4bmL&Vr-e!7`4Z{|wxE>6sH1pV& z?s@!IHTA}qh|nmWe5VTmUM<~M8Q60x(=u~X4WZ^3KU~WJG6zIM&FMlnM}p^vQG?RH zb1zpd3a{#Kd8IwyLLFv~5yYHtOkA21!Ttl%P;<^QFgyUt!u_|vDVT3Y?(Wp~x*OMI z7Mu`!qWbih9s^f?Nk(c>d{JsaK2R|jgao;|0vVDFCJF{zdarflQUWg;b_e9Wx%<;> f>#TUA9ftBt^A>VEd3K5IXF$ujji;|kMu`FdoHTt0 diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/info/exclude b/test/integration/submoduleReset/expected/repo/.git_keep/info/exclude deleted file mode 100644 index 8e9f2071f..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/info/exclude +++ /dev/null @@ -1,7 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ -.DS_Store diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/logs/HEAD b/test/integration/submoduleReset/expected/repo/.git_keep/logs/HEAD deleted file mode 100644 index d10fa88d0..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/logs/HEAD +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 a50a5125768001a3ea263ffb7cafbc421a508153 CI 1534792759 +0100 commit (initial): myfile1 -a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 -42530e986dbb65877ed8d61ca0c816e425e5c62e 9d10a5a0a21eb2cfdb6206f474ed57fd5cd51440 CI 1534792759 +0100 commit: add submodule diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/submoduleReset/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index d10fa88d0..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 a50a5125768001a3ea263ffb7cafbc421a508153 CI 1534792759 +0100 commit (initial): myfile1 -a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e CI 1534792759 +0100 commit: myfile2 -42530e986dbb65877ed8d61ca0c816e425e5c62e 9d10a5a0a21eb2cfdb6206f474ed57fd5cd51440 CI 1534792759 +0100 commit: add submodule diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/HEAD b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/HEAD deleted file mode 100644 index a70ff80c0..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/HEAD +++ /dev/null @@ -1 +0,0 @@ -42530e986dbb65877ed8d61ca0c816e425e5c62e diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/ORIG_HEAD b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/ORIG_HEAD deleted file mode 100644 index ab99dc85b..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -a50a5125768001a3ea263ffb7cafbc421a508153 diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/config b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/config deleted file mode 100644 index 57da72856..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/config +++ /dev/null @@ -1,14 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true - worktree = ../../../other_repo -[remote "origin"] - url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleReset/actual/other_repo - fetch = +refs/heads/*:refs/remotes/origin/* -[branch "master"] - remote = origin - merge = refs/heads/master diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/description b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/index b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/index deleted file mode 100644 index e02fb97112edcba96fb5851e08e7d1ce953662f4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 209 zcmZ?q402{*U|<5_B>U6fm^iL9!DvPX23DrIKLi;V8kaCIFn$H95dmVhrF$O#RZYF| zB_cG6C*SEpfLBZRRR;Fl%CyX!R70SGB>OW=It#X4fzeQNO3}@c;Q3+HptSGY%T 1534792759 +0100 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleReset/actual/other_repo -42530e986dbb65877ed8d61ca0c816e425e5c62e a50a5125768001a3ea263ffb7cafbc421a508153 Jesse Duffield 1648348154 +1100 rebase -i (start): checkout a50a5125768001a3ea263ffb7cafbc421a508153 -a50a5125768001a3ea263ffb7cafbc421a508153 a50a5125768001a3ea263ffb7cafbc421a508153 Jesse Duffield 1648348154 +1100 rebase -i (finish): returning to refs/heads/master -a50a5125768001a3ea263ffb7cafbc421a508153 a50a5125768001a3ea263ffb7cafbc421a508153 Jesse Duffield 1648348162 +1100 reset: moving to HEAD -a50a5125768001a3ea263ffb7cafbc421a508153 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1648348162 +1100 checkout: moving from master to 42530e986dbb65877ed8d61ca0c816e425e5c62e diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/logs/refs/heads/master b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/logs/refs/heads/master deleted file mode 100644 index 07a1588f3..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/logs/refs/heads/master +++ /dev/null @@ -1,2 +0,0 @@ -0000000000000000000000000000000000000000 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1534792759 +0100 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleReset/actual/other_repo -42530e986dbb65877ed8d61ca0c816e425e5c62e a50a5125768001a3ea263ffb7cafbc421a508153 Jesse Duffield 1648348154 +1100 rebase -i (finish): refs/heads/master onto a50a5125768001a3ea263ffb7cafbc421a508153 diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/logs/refs/remotes/origin/HEAD b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/logs/refs/remotes/origin/HEAD deleted file mode 100644 index ac58921d8..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/logs/refs/remotes/origin/HEAD +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 42530e986dbb65877ed8d61ca0c816e425e5c62e Jesse Duffield 1534792759 +0100 clone: from /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/submoduleReset/actual/other_repo diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/logs/refs/stash b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/logs/refs/stash deleted file mode 100644 index 455599518..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/logs/refs/stash +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 874e570cb4ea7387ba59054b315aa584038cacea Jesse Duffield 1648348162 +1100 WIP on master: a50a512 myfile1 diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmb -jհWJJ_L})ܠNPd&%J \ No newline at end of file diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/17/defcd0e1f9ad96542aa66845e53cb46c91c30d b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/17/defcd0e1f9ad96542aa66845e53cb46c91c30d deleted file mode 100644 index a908456d800f1b32337b13ce6b0eb16ae48c82cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 86 zcmV-c0IC0Y0V^p=O;s>AW-v4`Ff%bx$gNDv%t~ZE#08nZNMgRZ+ diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e deleted file mode 100644 index 64d20cb1ea175608a3e05acff298a97ed57eb7b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 150 zcmV;H0BQet0gaA93c@fDMP26<*$Xn6B$Eb2gsyswNjrlDV@rvkw>L*{``_d7=dISY zS(n499U_*K4~}D2SQZh@l!dYu@-!gPf>=N?I5ImQ@@keNaC8_G4FHb4Fp^g-X=W{R zz}|wvMQ`}s9@}BZ$zI3lE+4M@Q!evXZ?@x*GNzdA861G=Yd_WGPug%8Z-­J -W^CA#%_TEF }/`݅RGbi$+H{PƁ/iܫKk>~Xxd]D1nۧ8_%˛[n7_qwfWn \ No newline at end of file diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 deleted file mode 100644 index 5dd5f3236..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 +++ /dev/null @@ -1,2 +0,0 @@ -xM -0@sJ&N  I޾/ZHR%d"r@X<-4dG5?fxN(_& 6]פ˟\ճ5, \ No newline at end of file diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 deleted file mode 100644 index 285df3e5fbab12262e28d85e78af8a31cd0024c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb`~^A08nuUMF0Q* diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 deleted file mode 100644 index 96d2e71a6af75cdd27ac5d9628a27faecc40fb66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77 zcmV-T0J8sh0V^p=O;s>AU@$Z=Ff%bx$gNDv%tB=N-?^8o7KK;!x4hDxZ=ntVWIZ01*pecg diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/d2/2afbf8d80bbd74bcd87cae8a17a0315cfc915b b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/objects/d2/2afbf8d80bbd74bcd87cae8a17a0315cfc915b deleted file mode 100644 index 7b37fd58d5295a81a2cf8007ebcf3b00b0e2aabd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 180 zcmV;l089UP0i};kYQr!Pg|pTvW*;aT{fy-hN)}z^7Gr7DDp+>06=-i?1(FkV`8^&V z@5Qy&(!h{Cv`qwXNRngHf_daLl6QugC^#?P#>r6}F>01uE~|b$UI3`kTuvsQv)=$5d8Re^yrj diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/packed-refs b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/packed-refs deleted file mode 100644 index 2991aad64..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/packed-refs +++ /dev/null @@ -1,2 +0,0 @@ -# pack-refs with: peeled fully-peeled sorted -42530e986dbb65877ed8d61ca0c816e425e5c62e refs/remotes/origin/master diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/refs/heads/master b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/refs/heads/master deleted file mode 100644 index ab99dc85b..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -a50a5125768001a3ea263ffb7cafbc421a508153 diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/refs/remotes/origin/HEAD b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/refs/remotes/origin/HEAD deleted file mode 100644 index 6efe28fff..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/refs/remotes/origin/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/remotes/origin/master diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/refs/stash b/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/refs/stash deleted file mode 100644 index 5d3437a08..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/modules/other_repo/refs/stash +++ /dev/null @@ -1 +0,0 @@ -874e570cb4ea7387ba59054b315aa584038cacea diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/submoduleReset/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmb~ZE#08nZNMgRZ+ diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff b/test/integration/submoduleReset/expected/repo/.git_keep/objects/2b/864257bf2d49adbad8785540d85030a60852ff deleted file mode 100644 index 5bfb0cefc3370964e04c1d101231d7a71600af5a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 62 zcmV-E0Kxxw0ZYosPf{>5Wr!{=P0GzrDa}b$P|7dKNG*ylN-fA&isj-gNG!=vuvI_^ Ua&eXx7F=sF|FfcPQQP4}zEXmDJDa}bOX3%bP3g55mxpvo$icp6e z0S3!Bg8oC5eFL-0IJ$O E95viYm;e9( diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e b/test/integration/submoduleReset/expected/repo/.git_keep/objects/42/530e986dbb65877ed8d61ca0c816e425e5c62e deleted file mode 100644 index 64d20cb1ea175608a3e05acff298a97ed57eb7b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 150 zcmV;H0BQet0gaA93c@fDMP26<*$Xn6B$Eb2gsyswNjrlDV@rvkw>L*{``_d7=dISY zS(n499U_*K4~}D2SQZh@l!dYu@-!gPf>=N?I5ImQ@@keNaC8_G4FHb4Fp^g-X=W{R zz}|wvMQ`}s9@}BZ$zI3lE+4M@Q!evXZ?@x*GNzdA861G=Yd_WGPuf02NDxmYnG(q3 z(BR@NRNDKaZF-vZb(-(^rni2Ozo33# G*F5F}&`WRt diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 b/test/integration/submoduleReset/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 deleted file mode 100644 index 5dd5f3236..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/objects/a5/0a5125768001a3ea263ffb7cafbc421a508153 +++ /dev/null @@ -1,2 +0,0 @@ -xM -0@sJ&N  I޾/ZHR%d"r@X<-4dG5?fxN(_& 6]פ˟\ճ5, \ No newline at end of file diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/submoduleReset/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 deleted file mode 100644 index 285df3e5fbab12262e28d85e78af8a31cd0024c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb`~^A08nuUMF0Q* diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/submoduleReset/expected/repo/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 deleted file mode 100644 index 96d2e71a6af75cdd27ac5d9628a27faecc40fb66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 77 zcmV-T0J8sh0V^p=O;s>AU@$Z=Ff%bx$gNDv%tB=N-?^8o7KK;!x4hDxZ=ntVWIZ01*pecg diff --git a/test/integration/submoduleReset/expected/repo/.git_keep/refs/heads/master b/test/integration/submoduleReset/expected/repo/.git_keep/refs/heads/master deleted file mode 100644 index ad2d893d7..000000000 --- a/test/integration/submoduleReset/expected/repo/.git_keep/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -9d10a5a0a21eb2cfdb6206f474ed57fd5cd51440 diff --git a/test/integration/submoduleReset/expected/repo/.gitmodules_keep b/test/integration/submoduleReset/expected/repo/.gitmodules_keep deleted file mode 100644 index 2b864257b..000000000 --- a/test/integration/submoduleReset/expected/repo/.gitmodules_keep +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "other_repo"] - path = other_repo - url = ../other_repo diff --git a/test/integration/submoduleReset/expected/repo/myfile1 b/test/integration/submoduleReset/expected/repo/myfile1 deleted file mode 100644 index a5bce3fd2..000000000 --- a/test/integration/submoduleReset/expected/repo/myfile1 +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/test/integration/submoduleReset/expected/repo/myfile2 b/test/integration/submoduleReset/expected/repo/myfile2 deleted file mode 100644 index 180cf8328..000000000 --- a/test/integration/submoduleReset/expected/repo/myfile2 +++ /dev/null @@ -1 +0,0 @@ -test2 diff --git a/test/integration/submoduleReset/expected/repo/other_repo/.git_keep b/test/integration/submoduleReset/expected/repo/other_repo/.git_keep deleted file mode 100644 index 32e5ae2e6..000000000 --- a/test/integration/submoduleReset/expected/repo/other_repo/.git_keep +++ /dev/null @@ -1 +0,0 @@ -gitdir: ../.git/modules/other_repo diff --git a/test/integration/submoduleReset/expected/repo/other_repo/myfile1 b/test/integration/submoduleReset/expected/repo/other_repo/myfile1 deleted file mode 100644 index a5bce3fd2..000000000 --- a/test/integration/submoduleReset/expected/repo/other_repo/myfile1 +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/test/integration/submoduleReset/expected/repo/other_repo/myfile2 b/test/integration/submoduleReset/expected/repo/other_repo/myfile2 deleted file mode 100644 index 180cf8328..000000000 --- a/test/integration/submoduleReset/expected/repo/other_repo/myfile2 +++ /dev/null @@ -1 +0,0 @@ -test2 diff --git a/test/integration/submoduleReset/recording.json b/test/integration/submoduleReset/recording.json deleted file mode 100644 index 2b272d7f5..000000000 --- a/test/integration/submoduleReset/recording.json +++ /dev/null @@ -1 +0,0 @@ -{"KeyEvents":[{"Timestamp":653,"Mod":0,"Key":256,"Ch":93},{"Timestamp":1685,"Mod":0,"Key":13,"Ch":13},{"Timestamp":2749,"Mod":0,"Key":259,"Ch":0},{"Timestamp":2893,"Mod":0,"Key":259,"Ch":0},{"Timestamp":3229,"Mod":0,"Key":256,"Ch":100},{"Timestamp":3661,"Mod":0,"Key":13,"Ch":13},{"Timestamp":4069,"Mod":0,"Key":260,"Ch":0},{"Timestamp":4189,"Mod":0,"Key":260,"Ch":0},{"Timestamp":5180,"Mod":0,"Key":256,"Ch":78},{"Timestamp":6508,"Mod":0,"Key":256,"Ch":32},{"Timestamp":7311,"Mod":0,"Key":27,"Ch":0},{"Timestamp":8212,"Mod":0,"Key":256,"Ch":91},{"Timestamp":10268,"Mod":0,"Key":256,"Ch":100},{"Timestamp":12165,"Mod":0,"Key":13,"Ch":13},{"Timestamp":13741,"Mod":0,"Key":256,"Ch":93},{"Timestamp":14317,"Mod":0,"Key":13,"Ch":13},{"Timestamp":16645,"Mod":0,"Key":259,"Ch":0},{"Timestamp":16805,"Mod":0,"Key":259,"Ch":0},{"Timestamp":17005,"Mod":0,"Key":259,"Ch":0},{"Timestamp":18588,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]} \ No newline at end of file diff --git a/test/integration/submoduleReset/setup.sh b/test/integration/submoduleReset/setup.sh deleted file mode 100644 index cd5b3ce64..000000000 --- a/test/integration/submoduleReset/setup.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -set -e - -cd $1 - -export GIT_COMMITTER_DATE="Mon 20 Aug 2018 20:19:19 BST" -export GIT_AUTHOR_DATE="Mon 20 Aug 2018 20:19:19 BST" - -git init - -git config user.email "CI@example.com" -git config user.name "CI" - -echo test1 > myfile1 -git add . -git commit -am "myfile1" -echo test2 > myfile2 -git add . -git commit -am "myfile2" - -cd .. -git clone --bare ./repo other_repo -cd repo - -git -c protocol.file.allow=always submodule add ../other_repo -git commit -am "add submodule" diff --git a/test/integration/submoduleReset/test.json b/test/integration/submoduleReset/test.json deleted file mode 100644 index ccac209e4..000000000 --- a/test/integration/submoduleReset/test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "description": "After making some changes in a submodule, we reset the submodule from the parent repo", - "speed": 10 -}