From cc5d13c833daaba4a27507ce33e5de90ed8b1567 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 23 Mar 2022 23:15:54 +1100 Subject: [PATCH] allow adding whole diff to patch this was causing a panic add integration test for toggling all commit files --- docs/keybindings/Keybindings_en.md | 1 + docs/keybindings/Keybindings_nl.md | 1 + docs/keybindings/Keybindings_pl.md | 1 + docs/keybindings/Keybindings_zh.md | 1 + .../controllers/commits_files_controller.go | 65 +++++++++++------- pkg/i18n/english.go | 4 ++ pkg/integration/integration.go | 3 +- .../expected/.git_keep/COMMIT_EDITMSG | 1 + .../expected/.git_keep/FETCH_HEAD | 0 .../expected/.git_keep/HEAD | 1 + .../expected/.git_keep/config | 10 +++ .../expected/.git_keep/description | 1 + .../expected/.git_keep/index | Bin 0 -> 163 bytes .../expected/.git_keep/info/exclude | 7 ++ .../expected/.git_keep/logs/HEAD | 2 + .../expected/.git_keep/logs/refs/heads/master | 2 + .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 0 -> 21 bytes .../41/05b6da4ccc191a4abd24b1ffac6a2031534c0b | Bin 0 -> 45 bytes .../44/eb4bd0e7419049a8e4176945786c20dae60d7c | Bin 0 -> 126 bytes .../4b/825dc642cb6eb9a060e54bf8d69288fbee4904 | Bin 0 -> 15 bytes .../4f/346f1ad5ba2917da2109e2eaa2f2dfbb86f10f | Bin 0 -> 21 bytes .../68/bbd52379d849022495dcfd11b13f2fb3103d37 | Bin 0 -> 46 bytes .../70/28eaec19b2723b62690974057c92ba7d8c1b11 | Bin 0 -> 121 bytes .../83/90c32b5e687b97e242da46498b574ace0e1eb5 | Bin 0 -> 21 bytes .../98/1651deb012f8e684dd306c1f5bf8edd5c3db67 | Bin 0 -> 106 bytes .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 0 -> 21 bytes .../cf/149a94a18c990b2c5cdd0cf15ec4880f51c8b0 | 4 ++ .../d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 | Bin 0 -> 21 bytes .../df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b | Bin 0 -> 21 bytes .../expected/.git_keep/refs/heads/master | 1 + .../expected/one/two/three/file3 | 1 + .../patchBuildingToggleAll/recording.json | 1 + .../patchBuildingToggleAll/setup.sh | 23 +++++++ .../patchBuildingToggleAll/test.json | 1 + 34 files changed, 103 insertions(+), 28 deletions(-) create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/COMMIT_EDITMSG create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/FETCH_HEAD create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/HEAD create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/config create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/description create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/index create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/info/exclude create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/logs/HEAD create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/logs/refs/heads/master create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/objects/41/05b6da4ccc191a4abd24b1ffac6a2031534c0b create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/objects/44/eb4bd0e7419049a8e4176945786c20dae60d7c create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/objects/4f/346f1ad5ba2917da2109e2eaa2f2dfbb86f10f create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/objects/68/bbd52379d849022495dcfd11b13f2fb3103d37 create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/objects/70/28eaec19b2723b62690974057c92ba7d8c1b11 create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/objects/83/90c32b5e687b97e242da46498b574ace0e1eb5 create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/objects/98/1651deb012f8e684dd306c1f5bf8edd5c3db67 create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/objects/cf/149a94a18c990b2c5cdd0cf15ec4880f51c8b0 create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b create mode 100644 test/integration/patchBuildingToggleAll/expected/.git_keep/refs/heads/master create mode 100644 test/integration/patchBuildingToggleAll/expected/one/two/three/file3 create mode 100644 test/integration/patchBuildingToggleAll/recording.json create mode 100644 test/integration/patchBuildingToggleAll/setup.sh create mode 100644 test/integration/patchBuildingToggleAll/test.json diff --git a/docs/keybindings/Keybindings_en.md b/docs/keybindings/Keybindings_en.md index acac130a4..662631386 100644 --- a/docs/keybindings/Keybindings_en.md +++ b/docs/keybindings/Keybindings_en.md @@ -123,6 +123,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct o: open file e: edit file space: toggle file included in patch + a: toggle all files included in patch enter: enter file to add selected lines to the patch (or toggle directory collapsed) `: toggle file tree view diff --git a/docs/keybindings/Keybindings_nl.md b/docs/keybindings/Keybindings_nl.md index 428d9507b..dd9c45ad2 100644 --- a/docs/keybindings/Keybindings_nl.md +++ b/docs/keybindings/Keybindings_nl.md @@ -123,6 +123,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct o: open bestand e: verander bestand space: toggle bestand inbegrepen in patch + a: toggle all files included in patch enter: enter bestand om geselecteerde regels toe te voegen aan de patch `: toggle bestandsboom weergave diff --git a/docs/keybindings/Keybindings_pl.md b/docs/keybindings/Keybindings_pl.md index fd26ea20d..2d032e5e3 100644 --- a/docs/keybindings/Keybindings_pl.md +++ b/docs/keybindings/Keybindings_pl.md @@ -123,6 +123,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct o: otwórz plik e: edytuj plik space: toggle file included in patch + a: toggle all files included in patch enter: enter file to add selected lines to the patch (or toggle directory collapsed) `: toggle file tree view diff --git a/docs/keybindings/Keybindings_zh.md b/docs/keybindings/Keybindings_zh.md index c075a7879..12b9a90f7 100644 --- a/docs/keybindings/Keybindings_zh.md +++ b/docs/keybindings/Keybindings_zh.md @@ -123,6 +123,7 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct o: 打开文件 e: 编辑文件 space: 补丁中包含的切换文件 + a: toggle all files included in patch enter: 输入文件以将所选行添加到补丁中(或切换目录折叠) `: 切换文件树视图 diff --git a/pkg/gui/controllers/commits_files_controller.go b/pkg/gui/controllers/commits_files_controller.go index 978d6c6a7..65b930ef6 100644 --- a/pkg/gui/controllers/commits_files_controller.go +++ b/pkg/gui/controllers/commits_files_controller.go @@ -52,6 +52,11 @@ func (self *CommitFilesController) GetKeybindings(opts types.KeybindingsOpts) [] Handler: self.checkSelected(self.toggleForPatch), Description: self.c.Tr.LcToggleAddToPatch, }, + { + Key: opts.GetKey(opts.Config.Files.ToggleStagedAll), + Handler: self.checkSelected(self.toggleAllForPatch), + Description: self.c.Tr.LcToggleAllInPatch, + }, { Key: opts.GetKey(opts.Config.Universal.GoInto), Handler: self.checkSelected(self.enter), @@ -150,35 +155,37 @@ func (self *CommitFilesController) edit(node *filetree.CommitFileNode) error { } func (self *CommitFilesController) toggleForPatch(node *filetree.CommitFileNode) error { - toggleTheFile := func() error { - if !self.git.Patch.PatchManager.Active() { - if err := self.startPatchManager(); err != nil { - return err + toggle := func() error { + return self.c.WithWaitingStatus(self.c.Tr.LcUpdatingPatch, func() error { + if !self.git.Patch.PatchManager.Active() { + if err := self.startPatchManager(); err != nil { + return err + } } - } - // if there is any file that hasn't been fully added we'll fully add everything, - // otherwise we'll remove everything - adding := node.AnyFile(func(file *models.CommitFile) bool { - return self.git.Patch.PatchManager.GetFileStatus(file.Name, self.context().GetRefName()) != patch.WHOLE - }) + // if there is any file that hasn't been fully added we'll fully add everything, + // otherwise we'll remove everything + adding := node.AnyFile(func(file *models.CommitFile) bool { + return self.git.Patch.PatchManager.GetFileStatus(file.Name, self.context().GetRefName()) != patch.WHOLE + }) - err := node.ForEachFile(func(file *models.CommitFile) error { - if adding { - return self.git.Patch.PatchManager.AddFileWhole(file.Name) - } else { - return self.git.Patch.PatchManager.RemoveFile(file.Name) + err := node.ForEachFile(func(file *models.CommitFile) error { + if adding { + return self.git.Patch.PatchManager.AddFileWhole(file.Name) + } else { + return self.git.Patch.PatchManager.RemoveFile(file.Name) + } + }) + if err != nil { + return self.c.Error(err) } + + if self.git.Patch.PatchManager.IsEmpty() { + self.git.Patch.PatchManager.Reset() + } + + return self.c.PostRefreshUpdate(self.context()) }) - if err != nil { - return self.c.Error(err) - } - - if self.git.Patch.PatchManager.IsEmpty() { - self.git.Patch.PatchManager.Reset() - } - - return self.c.PostRefreshUpdate(self.context()) } if self.git.Patch.PatchManager.Active() && self.git.Patch.PatchManager.To != self.context().GetRefName() { @@ -187,12 +194,18 @@ func (self *CommitFilesController) toggleForPatch(node *filetree.CommitFileNode) Prompt: self.c.Tr.DiscardPatchConfirm, HandleConfirm: func() error { self.git.Patch.PatchManager.Reset() - return toggleTheFile() + return toggle() }, }) } - return toggleTheFile() + return toggle() +} + +func (self *CommitFilesController) toggleAllForPatch(_ *filetree.CommitFileNode) error { + // not a fan of type assertions but this will be fixed very soon thanks to generics + root := self.context().CommitFileTreeViewModel.Tree().(*filetree.CommitFileNode) + return self.toggleForPatch(root) } func (self *CommitFilesController) startPatchManager() error { diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index aba4e9368..db25cf0a6 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -275,6 +275,8 @@ type TranslationSet struct { DiscardPatchConfirm string CantPatchWhileRebasingError string LcToggleAddToPatch string + LcToggleAllInPatch string + LcUpdatingPatch string ViewPatchOptions string PatchOptionsTitle string NoPatchError string @@ -846,6 +848,8 @@ func EnglishTranslationSet() TranslationSet { DiscardPatchConfirm: "You can only build a patch from one commit/stash-entry at a time. Discard current patch?", CantPatchWhileRebasingError: "You cannot build a patch or run patch commands while in a merging or rebasing state", LcToggleAddToPatch: "toggle file included in patch", + LcToggleAllInPatch: "toggle all files included in patch", + LcUpdatingPatch: "updating patch", ViewPatchOptions: "view custom patch options", PatchOptionsTitle: "Patch Options", NoPatchError: "No patch created yet. To start building a patch, use 'space' on a commit file or enter to add specific lines", diff --git a/pkg/integration/integration.go b/pkg/integration/integration.go index 86049a230..bb2d7a0b0 100644 --- a/pkg/integration/integration.go +++ b/pkg/integration/integration.go @@ -94,8 +94,7 @@ func RunTests( continue } - fnWrapper(test, func(t *testing.T) error { - t.Helper() + fnWrapper(test, func(t *testing.T) error { //nolint: thelper speeds := getTestSpeeds(test.Speed, mode, speedEnv) testPath := filepath.Join(testDir, test.Name) actualRepoDir := filepath.Join(testPath, "actual") diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/COMMIT_EDITMSG b/test/integration/patchBuildingToggleAll/expected/.git_keep/COMMIT_EDITMSG new file mode 100644 index 000000000..907b30816 --- /dev/null +++ b/test/integration/patchBuildingToggleAll/expected/.git_keep/COMMIT_EDITMSG @@ -0,0 +1 @@ +blah diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/FETCH_HEAD b/test/integration/patchBuildingToggleAll/expected/.git_keep/FETCH_HEAD new file mode 100644 index 000000000..e69de29bb diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/HEAD b/test/integration/patchBuildingToggleAll/expected/.git_keep/HEAD new file mode 100644 index 000000000..cb089cd89 --- /dev/null +++ b/test/integration/patchBuildingToggleAll/expected/.git_keep/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/config b/test/integration/patchBuildingToggleAll/expected/.git_keep/config new file mode 100644 index 000000000..8ae104545 --- /dev/null +++ b/test/integration/patchBuildingToggleAll/expected/.git_keep/config @@ -0,0 +1,10 @@ +[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/patchBuildingToggleAll/expected/.git_keep/description b/test/integration/patchBuildingToggleAll/expected/.git_keep/description new file mode 100644 index 000000000..498b267a8 --- /dev/null +++ b/test/integration/patchBuildingToggleAll/expected/.git_keep/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/index b/test/integration/patchBuildingToggleAll/expected/.git_keep/index new file mode 100644 index 0000000000000000000000000000000000000000..291d34ebebffe18e21251c8c853556342abe66a3 GIT binary patch literal 163 zcmZ?q402{*U|<4b#w2TjQs$!90UFB0$V`Kbu$kOxd$H z{HGKSsS9}dYwS8A%^;kgm#SY6UGC(>&Oarc?3yyPmeeUHbdQ!3BfN08|tA<%=0J-ZfZ~y=R literal 0 HcmV?d00001 diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/info/exclude b/test/integration/patchBuildingToggleAll/expected/.git_keep/info/exclude new file mode 100644 index 000000000..8e9f2071f --- /dev/null +++ b/test/integration/patchBuildingToggleAll/expected/.git_keep/info/exclude @@ -0,0 +1,7 @@ +# 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/patchBuildingToggleAll/expected/.git_keep/logs/HEAD b/test/integration/patchBuildingToggleAll/expected/.git_keep/logs/HEAD new file mode 100644 index 000000000..30dd712e1 --- /dev/null +++ b/test/integration/patchBuildingToggleAll/expected/.git_keep/logs/HEAD @@ -0,0 +1,2 @@ +0000000000000000000000000000000000000000 7028eaec19b2723b62690974057c92ba7d8c1b11 CI 1648038005 +1100 commit (initial): first commit +7028eaec19b2723b62690974057c92ba7d8c1b11 cf149a94a18c990b2c5cdd0cf15ec4880f51c8b0 CI 1648038005 +1100 commit: blah diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/logs/refs/heads/master b/test/integration/patchBuildingToggleAll/expected/.git_keep/logs/refs/heads/master new file mode 100644 index 000000000..30dd712e1 --- /dev/null +++ b/test/integration/patchBuildingToggleAll/expected/.git_keep/logs/refs/heads/master @@ -0,0 +1,2 @@ +0000000000000000000000000000000000000000 7028eaec19b2723b62690974057c92ba7d8c1b11 CI 1648038005 +1100 commit (initial): first commit +7028eaec19b2723b62690974057c92ba7d8c1b11 cf149a94a18c990b2c5cdd0cf15ec4880f51c8b0 CI 1648038005 +1100 commit: blah diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 b/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 new file mode 100644 index 0000000000000000000000000000000000000000..f74bf2335bbc5999ad0faff94fb04165d8ab5c7d GIT binary patch literal 21 ccmb~ZE#08nZNMgRZ+ literal 0 HcmV?d00001 diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/41/05b6da4ccc191a4abd24b1ffac6a2031534c0b b/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/41/05b6da4ccc191a4abd24b1ffac6a2031534c0b new file mode 100644 index 0000000000000000000000000000000000000000..a35700d0e194beeac2dbf4a54a84aa39ea6a1bc3 GIT binary patch literal 45 zcmb7HexU|FfcPQQAo?oNi}3xy65p<)zlkbB0{5h@|`XOc(rt2 zMN(kIAi?v)s6lDpxtFUJg;({rywaX;p^l`$nBjglulAX;XK(mVDI8K4@bcH#bwnCT gfeFJUlcNv9{}~-CdzJp;w8fXC*jukd0F1skmKlsaH2?qr literal 0 HcmV?d00001 diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 b/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 new file mode 100644 index 0000000000000000000000000000000000000000..adf64119a33d7621aeeaa505d30adb58afaa5559 GIT binary patch literal 15 Wcmb{;fo08o?%QUCw| literal 0 HcmV?d00001 diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/68/bbd52379d849022495dcfd11b13f2fb3103d37 b/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/68/bbd52379d849022495dcfd11b13f2fb3103d37 new file mode 100644 index 0000000000000000000000000000000000000000..15e2a131e84692e3d53bfa3c48d999c254444784 GIT binary patch literal 46 zcmbHR*A?9DejUHPx;=k6GsE9o0-*qn C^b>mk literal 0 HcmV?d00001 diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/70/28eaec19b2723b62690974057c92ba7d8c1b11 b/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/70/28eaec19b2723b62690974057c92ba7d8c1b11 new file mode 100644 index 0000000000000000000000000000000000000000..a3f20d2e948191e2afb72611db44508657965d60 GIT binary patch literal 121 zcmV-<0EYi~0ga783c@fD06pgwdlzIAH(>)JLQj20l5VhIh{P58{1*Ix*I|Y!y|q=r zdVA6#0+iYLr37*%2gxyEK=G6-FCjYSnnfrgne^3XA27{uo92gXsl8uvDZSmn24cK2 bqKC7!h~}WjMCDK2)OCCmewEn)8D1{oTiiGJ literal 0 HcmV?d00001 diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/83/90c32b5e687b97e242da46498b574ace0e1eb5 b/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/83/90c32b5e687b97e242da46498b574ace0e1eb5 new file mode 100644 index 0000000000000000000000000000000000000000..be495f3991a70f570da18905f0d6f17de4d85e73 GIT binary patch literal 21 ccmb#rs)x-b@6iPCH1~Rz3_P+4kaf0WHC*ql|6*&sG Mp7GWI01x&lI9Dz+CjbBd literal 0 HcmV?d00001 diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 new file mode 100644 index 0000000000000000000000000000000000000000..285df3e5fbab12262e28d85e78af8a31cd0024c1 GIT binary patch literal 21 ccmb`~^A08nuUMF0Q* literal 0 HcmV?d00001 diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/cf/149a94a18c990b2c5cdd0cf15ec4880f51c8b0 b/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/cf/149a94a18c990b2c5cdd0cf15ec4880f51c8b0 new file mode 100644 index 000000000..5d9dcc080 --- /dev/null +++ b/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/cf/149a94a18c990b2c5cdd0cf15ec4880f51c8b0 @@ -0,0 +1,4 @@ +xM +@ @as ADHҔ +[9ǷxjSi "=R ]`\D}lpN08nuUO8@`> literal 0 HcmV?d00001 diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b b/test/integration/patchBuildingToggleAll/expected/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b new file mode 100644 index 0000000000000000000000000000000000000000..9b771fc2f6f41f91b00976b4ff3f8f9935f7931e GIT binary patch literal 21 ccmb>`CU&08otwO#lD@ literal 0 HcmV?d00001 diff --git a/test/integration/patchBuildingToggleAll/expected/.git_keep/refs/heads/master b/test/integration/patchBuildingToggleAll/expected/.git_keep/refs/heads/master new file mode 100644 index 000000000..6e12466a8 --- /dev/null +++ b/test/integration/patchBuildingToggleAll/expected/.git_keep/refs/heads/master @@ -0,0 +1 @@ +cf149a94a18c990b2c5cdd0cf15ec4880f51c8b0 diff --git a/test/integration/patchBuildingToggleAll/expected/one/two/three/file3 b/test/integration/patchBuildingToggleAll/expected/one/two/three/file3 new file mode 100644 index 000000000..df6b0d2bc --- /dev/null +++ b/test/integration/patchBuildingToggleAll/expected/one/two/three/file3 @@ -0,0 +1 @@ +test3 diff --git a/test/integration/patchBuildingToggleAll/recording.json b/test/integration/patchBuildingToggleAll/recording.json new file mode 100644 index 000000000..52feb4966 --- /dev/null +++ b/test/integration/patchBuildingToggleAll/recording.json @@ -0,0 +1 @@ +{"KeyEvents":[{"Timestamp":624,"Mod":0,"Key":259,"Ch":0},{"Timestamp":813,"Mod":0,"Key":259,"Ch":0},{"Timestamp":1216,"Mod":0,"Key":13,"Ch":13},{"Timestamp":1841,"Mod":0,"Key":256,"Ch":97},{"Timestamp":2456,"Mod":0,"Key":258,"Ch":0},{"Timestamp":2624,"Mod":0,"Key":258,"Ch":0},{"Timestamp":2841,"Mod":0,"Key":256,"Ch":32},{"Timestamp":3600,"Mod":2,"Key":16,"Ch":16},{"Timestamp":4795,"Mod":0,"Key":258,"Ch":0},{"Timestamp":5193,"Mod":0,"Key":258,"Ch":0},{"Timestamp":5696,"Mod":0,"Key":13,"Ch":13},{"Timestamp":7345,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]} \ No newline at end of file diff --git a/test/integration/patchBuildingToggleAll/setup.sh b/test/integration/patchBuildingToggleAll/setup.sh new file mode 100644 index 000000000..c552b9e56 --- /dev/null +++ b/test/integration/patchBuildingToggleAll/setup.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +cd $1 + +git init + +git config user.email "CI@example.com" +git config user.name "CI" + +git commit --allow-empty -m "first commit" + +mkdir -p one/two/three +echo test1 > one/two/three/file1 +echo test2 > one/two/three/file2 +echo test3 > one/two/three/file3 +echo test4 > one/two/three/file4 +echo test5 > one/two/file1 +echo test6 > one/two/file2 + +git add . +git commit -m "blah" diff --git a/test/integration/patchBuildingToggleAll/test.json b/test/integration/patchBuildingToggleAll/test.json new file mode 100644 index 000000000..1804ea8aa --- /dev/null +++ b/test/integration/patchBuildingToggleAll/test.json @@ -0,0 +1 @@ +{ "description": "messing with our patch building flow in both flat and tree view", "speed": 10 }