From 8a1c7639426c2ceee562674adde85dd9a5b46127 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 28 Dec 2022 17:15:59 +1100 Subject: [PATCH 1/6] more git ignore stuff in integration test --- .../tests/file/exclude_gitignore.go | 39 ----------- pkg/integration/tests/file/gitignore.go | 63 ++++++++++++++++++ pkg/integration/tests/tests.go | 2 +- .../expected/repo/.git_keep/COMMIT_EDITMSG | 1 - .../expected/repo/.git_keep/FETCH_HEAD | 0 .../excludeMenu/expected/repo/.git_keep/HEAD | 1 - .../expected/repo/.git_keep/config | 10 --- .../expected/repo/.git_keep/description | 1 - .../excludeMenu/expected/repo/.git_keep/index | Bin 65 -> 0 bytes .../expected/repo/.git_keep/info/exclude | 9 --- .../expected/repo/.git_keep/logs/HEAD | 1 - .../repo/.git_keep/logs/refs/heads/master | 1 - .../12/9cdae0c4ccd050e8398bcb18b2ce1e4a5626f9 | Bin 123 -> 0 bytes .../4b/825dc642cb6eb9a060e54bf8d69288fbee4904 | Bin 15 -> 0 bytes .../expected/repo/.git_keep/refs/heads/master | 1 - .../excludeMenu/expected/repo/myfile1 | 1 - test/integration/excludeMenu/recording.json | 1 - test/integration/excludeMenu/setup.sh | 15 ----- test/integration/excludeMenu/test.json | 4 -- 19 files changed, 64 insertions(+), 86 deletions(-) delete mode 100644 pkg/integration/tests/file/exclude_gitignore.go create mode 100644 pkg/integration/tests/file/gitignore.go delete mode 100644 test/integration/excludeMenu/expected/repo/.git_keep/COMMIT_EDITMSG delete mode 100644 test/integration/excludeMenu/expected/repo/.git_keep/FETCH_HEAD delete mode 100644 test/integration/excludeMenu/expected/repo/.git_keep/HEAD delete mode 100644 test/integration/excludeMenu/expected/repo/.git_keep/config delete mode 100644 test/integration/excludeMenu/expected/repo/.git_keep/description delete mode 100644 test/integration/excludeMenu/expected/repo/.git_keep/index delete mode 100644 test/integration/excludeMenu/expected/repo/.git_keep/info/exclude delete mode 100644 test/integration/excludeMenu/expected/repo/.git_keep/logs/HEAD delete mode 100644 test/integration/excludeMenu/expected/repo/.git_keep/logs/refs/heads/master delete mode 100644 test/integration/excludeMenu/expected/repo/.git_keep/objects/12/9cdae0c4ccd050e8398bcb18b2ce1e4a5626f9 delete mode 100644 test/integration/excludeMenu/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 delete mode 100644 test/integration/excludeMenu/expected/repo/.git_keep/refs/heads/master delete mode 100644 test/integration/excludeMenu/expected/repo/myfile1 delete mode 100644 test/integration/excludeMenu/recording.json delete mode 100644 test/integration/excludeMenu/setup.sh delete mode 100644 test/integration/excludeMenu/test.json diff --git a/pkg/integration/tests/file/exclude_gitignore.go b/pkg/integration/tests/file/exclude_gitignore.go deleted file mode 100644 index 10ea62f15..000000000 --- a/pkg/integration/tests/file/exclude_gitignore.go +++ /dev/null @@ -1,39 +0,0 @@ -package file - -import ( - "github.com/jesseduffield/lazygit/pkg/config" - . "github.com/jesseduffield/lazygit/pkg/integration/components" -) - -var ExcludeGitignore = NewIntegrationTest(NewIntegrationTestArgs{ - Description: "Failed attempt at excluding and ignoring the .gitignore file", - ExtraCmdArgs: "", - Skip: false, - SetupConfig: func(config *config.AppConfig) { - }, - SetupRepo: func(shell *Shell) { - shell.CreateFile(".gitignore", "") - }, - Run: func(t *TestDriver, keys config.KeybindingConfig) { - t.Views().Files(). - IsFocused(). - Lines( - Contains(`?? .gitignore`).IsSelected(), - ). - Press(keys.Files.IgnoreFile). - Tap(func() { - t.ExpectPopup().Menu().Title(Equals("ignore or exclude file")).Select(Contains("add to .git/info/exclude")).Confirm() - - t.ExpectPopup().Alert().Title(Equals("Error")).Content(Equals("Cannot exclude .gitignore")).Confirm() - }). - Press(keys.Files.IgnoreFile). - Tap(func() { - t.ExpectPopup().Menu().Title(Equals("ignore or exclude file")).Select(Contains("add to .gitignore")).Confirm() - - t.ExpectPopup().Alert().Title(Equals("Error")).Content(Equals("Cannot ignore .gitignore")).Confirm() - }) - - t.FileSystem().FileContent(".gitignore", Equals("")) - t.FileSystem().FileContent(".git/info/exclude", DoesNotContain(".gitignore")) - }, -}) diff --git a/pkg/integration/tests/file/gitignore.go b/pkg/integration/tests/file/gitignore.go new file mode 100644 index 000000000..eca835e82 --- /dev/null +++ b/pkg/integration/tests/file/gitignore.go @@ -0,0 +1,63 @@ +package file + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var GitIgnore = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Verify that we can't ignore the .gitignore file, then ignore/exclude other files", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(config *config.AppConfig) { + }, + SetupRepo: func(shell *Shell) { + shell.CreateFile(".gitignore", "") + shell.CreateFile("toExclude", "") + shell.CreateFile("toIgnore", "") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Files(). + IsFocused(). + Lines( + Contains(`?? .gitignore`).IsSelected(), + Contains(`?? toExclude`), + Contains(`?? toIgnore`), + ). + Press(keys.Files.IgnoreFile). + // ensure we can't exclude the .gitignore file + Tap(func() { + t.ExpectPopup().Menu().Title(Equals("ignore or exclude file")).Select(Contains("add to .git/info/exclude")).Confirm() + + t.ExpectPopup().Alert().Title(Equals("Error")).Content(Equals("Cannot exclude .gitignore")).Confirm() + }). + Press(keys.Files.IgnoreFile). + // ensure we can't ignore the .gitignore file + Tap(func() { + t.ExpectPopup().Menu().Title(Equals("ignore or exclude file")).Select(Contains("add to .gitignore")).Confirm() + + t.ExpectPopup().Alert().Title(Equals("Error")).Content(Equals("Cannot ignore .gitignore")).Confirm() + + t.FileSystem().FileContent(".gitignore", Equals("")) + t.FileSystem().FileContent(".git/info/exclude", DoesNotContain(".gitignore")) + }). + SelectNextItem(). + Press(keys.Files.IgnoreFile). + // exclude a file + Tap(func() { + t.ExpectPopup().Menu().Title(Equals("ignore or exclude file")).Select(Contains("add to .git/info/exclude")).Confirm() + + t.FileSystem().FileContent(".gitignore", Equals("")) + t.FileSystem().FileContent(".git/info/exclude", Contains("toExclude")) + }). + SelectNextItem(). + Press(keys.Files.IgnoreFile). + // ignore a file + Tap(func() { + t.ExpectPopup().Menu().Title(Equals("ignore or exclude file")).Select(Contains("add to .gitignore")).Confirm() + + t.FileSystem().FileContent(".gitignore", Equals("toIgnore\n")) + t.FileSystem().FileContent(".git/info/exclude", Contains("toExclude")) + }) + }, +}) diff --git a/pkg/integration/tests/tests.go b/pkg/integration/tests/tests.go index da72f84ed..da101e06b 100644 --- a/pkg/integration/tests/tests.go +++ b/pkg/integration/tests/tests.go @@ -54,7 +54,7 @@ var tests = []*components.IntegrationTest{ file.DirWithUntrackedFile, file.DiscardChanges, file.DiscardStagedChanges, - file.ExcludeGitignore, + file.GitIgnore, interactive_rebase.AmendMerge, interactive_rebase.One, stash.Rename, diff --git a/test/integration/excludeMenu/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/excludeMenu/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 5852f4463..000000000 --- a/test/integration/excludeMenu/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Initial commit diff --git a/test/integration/excludeMenu/expected/repo/.git_keep/FETCH_HEAD b/test/integration/excludeMenu/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/excludeMenu/expected/repo/.git_keep/HEAD b/test/integration/excludeMenu/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/excludeMenu/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/excludeMenu/expected/repo/.git_keep/config b/test/integration/excludeMenu/expected/repo/.git_keep/config deleted file mode 100644 index 8ae104545..000000000 --- a/test/integration/excludeMenu/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/excludeMenu/expected/repo/.git_keep/description b/test/integration/excludeMenu/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/excludeMenu/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/excludeMenu/expected/repo/.git_keep/index b/test/integration/excludeMenu/expected/repo/.git_keep/index deleted file mode 100644 index 65d675154f23ffb2d0196e017d44a5e7017550f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65 zcmZ?q402{*U|<4bhL9jvS0E+HV4z^Y<=qr}%;|LA&IJiiy? 1657012793 +1000 commit (initial): Initial commit diff --git a/test/integration/excludeMenu/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/excludeMenu/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index d4002669d..000000000 --- a/test/integration/excludeMenu/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 129cdae0c4ccd050e8398bcb18b2ce1e4a5626f9 CI 1657012793 +1000 commit (initial): Initial commit diff --git a/test/integration/excludeMenu/expected/repo/.git_keep/objects/12/9cdae0c4ccd050e8398bcb18b2ce1e4a5626f9 b/test/integration/excludeMenu/expected/repo/.git_keep/objects/12/9cdae0c4ccd050e8398bcb18b2ce1e4a5626f9 deleted file mode 100644 index ffa5ec6527c917d3d2ef3b94fd6ec4876aa8087a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 123 zcmV->0EGW|0ga783d0}}0DJZodoPsLtVW@fLQXzI&4voGmav6Bzkz%p*I|Y!y|pT! z?QoHe87O;W=i^O&n4%t#({Op49e#y)fkW~80t8XwxxKHuPztlb}-%4)}(9Vvi d%@_u_YD82!-6z5)brs)LYFgpw)E{~lFONt5Jcs}Q diff --git a/test/integration/excludeMenu/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 b/test/integration/excludeMenu/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 deleted file mode 100644 index adf64119a33d7621aeeaa505d30adb58afaa5559..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15 Wcmb myfile1 - diff --git a/test/integration/excludeMenu/test.json b/test/integration/excludeMenu/test.json deleted file mode 100644 index b2ef1f3f4..000000000 --- a/test/integration/excludeMenu/test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "description": "In this test a file is added to .git/info/exclude using the ignore or exclude menu", - "speed": 5 -} \ No newline at end of file From 277ca706eb3dd793463f951a919763e2432d53e5 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 28 Dec 2022 17:39:45 +1100 Subject: [PATCH 2/6] migrate fetchPrune integration test --- pkg/integration/components/shell.go | 23 ++++++++ pkg/integration/tests/sync/fetch_prune.go | 49 ++++++++++++++++++ pkg/integration/tests/tests.go | 2 + test/integration/fetchPrune/config/config.yml | 10 ---- .../fetchPrune/expected/origin/HEAD | 1 - .../fetchPrune/expected/origin/config | 8 --- .../fetchPrune/expected/origin/description | 1 - .../fetchPrune/expected/origin/info/exclude | 7 --- .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../75/f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 | 3 -- .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../fetchPrune/expected/origin/packed-refs | 2 - .../expected/repo/.git_keep/COMMIT_EDITMSG | 1 - .../expected/repo/.git_keep/FETCH_HEAD | 1 - .../fetchPrune/expected/repo/.git_keep/HEAD | 1 - .../fetchPrune/expected/repo/.git_keep/config | 21 -------- .../expected/repo/.git_keep/description | 1 - .../fetchPrune/expected/repo/.git_keep/index | Bin 137 -> 0 bytes .../expected/repo/.git_keep/info/exclude | 7 --- .../expected/repo/.git_keep/logs/HEAD | 3 -- .../repo/.git_keep/logs/refs/heads/master | 1 - .../.git_keep/logs/refs/heads/other_branch | 1 - .../.git_keep/logs/refs/remotes/origin/master | 1 - .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../75/f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 | 3 -- .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../expected/repo/.git_keep/packed-refs | 1 - .../expected/repo/.git_keep/refs/heads/master | 1 - .../repo/.git_keep/refs/heads/other_branch | 1 - .../repo/.git_keep/refs/remotes/origin/master | 1 - .../fetchPrune/expected/repo/myfile1 | 1 - test/integration/fetchPrune/recording.json | 1 - test/integration/fetchPrune/setup.sh | 34 ------------ test/integration/fetchPrune/test.json | 4 -- 34 files changed, 74 insertions(+), 117 deletions(-) create mode 100644 pkg/integration/tests/sync/fetch_prune.go delete mode 100644 test/integration/fetchPrune/config/config.yml delete mode 100644 test/integration/fetchPrune/expected/origin/HEAD delete mode 100644 test/integration/fetchPrune/expected/origin/config delete mode 100644 test/integration/fetchPrune/expected/origin/description delete mode 100644 test/integration/fetchPrune/expected/origin/info/exclude delete mode 100644 test/integration/fetchPrune/expected/origin/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/fetchPrune/expected/origin/objects/75/f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 delete mode 100644 test/integration/fetchPrune/expected/origin/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/fetchPrune/expected/origin/packed-refs delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/COMMIT_EDITMSG delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/FETCH_HEAD delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/HEAD delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/config delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/description delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/index delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/info/exclude delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/logs/HEAD delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/logs/refs/heads/master delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/logs/refs/heads/other_branch delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/logs/refs/remotes/origin/master delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/objects/75/f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/packed-refs delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/refs/heads/master delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/refs/heads/other_branch delete mode 100644 test/integration/fetchPrune/expected/repo/.git_keep/refs/remotes/origin/master delete mode 100644 test/integration/fetchPrune/expected/repo/myfile1 delete mode 100644 test/integration/fetchPrune/recording.json delete mode 100644 test/integration/fetchPrune/setup.sh delete mode 100644 test/integration/fetchPrune/test.json diff --git a/pkg/integration/components/shell.go b/pkg/integration/components/shell.go index f54d0fa5a..bfd1c5f86 100644 --- a/pkg/integration/components/shell.go +++ b/pkg/integration/components/shell.go @@ -170,3 +170,26 @@ func (self *Shell) SetConfig(key string, value string) *Shell { self.RunCommand(fmt.Sprintf(`git config --local "%s" %s`, key, value)) return self } + +// creates a clone of the repo in a sibling directory and adds the clone +// as a remote, then fetches it. +func (self *Shell) CloneIntoRemote(name string) *Shell { + self.RunCommand(fmt.Sprintf("git clone --bare . ../%s", name)) + self.RunCommand(fmt.Sprintf("git remote add %s ../%s", name, name)) + self.RunCommand(fmt.Sprintf("git fetch %s", name)) + + return self +} + +// e.g. branch: 'master', upstream: 'origin/master' +func (self *Shell) SetBranchUpstream(branch string, upstream string) *Shell { + self.RunCommand(fmt.Sprintf("git branch --set-upstream-to=%s %s", upstream, branch)) + + return self +} + +func (self *Shell) RemoveRemoteBranch(remoteName string, branch string) *Shell { + self.RunCommand(fmt.Sprintf("git -C ../%s branch -d %s", remoteName, branch)) + + return self +} diff --git a/pkg/integration/tests/sync/fetch_prune.go b/pkg/integration/tests/sync/fetch_prune.go new file mode 100644 index 000000000..765a4ad36 --- /dev/null +++ b/pkg/integration/tests/sync/fetch_prune.go @@ -0,0 +1,49 @@ +package sync + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var FetchPrune = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Fetch from the remote with the 'prune' option set in the git config", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(config *config.AppConfig) { + config.UserConfig.Git.AutoFetch = false + }, + SetupRepo: func(shell *Shell) { + // This option makes it so that git checks for deleted branches in the remote + // upon fetching. + shell.SetConfig("fetch.prune", "true") + + shell.EmptyCommit("my commit message") + + shell.NewBranch("branch_to_remove") + shell.Checkout("master") + shell.CloneIntoRemote("origin") + shell.SetBranchUpstream("master", "origin/master") + shell.SetBranchUpstream("branch_to_remove", "origin/branch_to_remove") + + // # unbenownst to our test repo we're removing the branch on the remote, so upon + // # fetching with prune: true we expect git to realise the remote branch is gone + shell.RemoveRemoteBranch("origin", "branch_to_remove") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Branches(). + Lines( + Contains("master"), + Contains("branch_to_remove").DoesNotContain("upstream gone"), + ) + + t.Views().Files(). + IsFocused(). + Press(keys.Files.Fetch) + + t.Views().Branches(). + Lines( + Contains("master"), + Contains("branch_to_remove").Contains("upstream gone"), + ) + }, +}) diff --git a/pkg/integration/tests/tests.go b/pkg/integration/tests/tests.go index da101e06b..8a6c52565 100644 --- a/pkg/integration/tests/tests.go +++ b/pkg/integration/tests/tests.go @@ -21,6 +21,7 @@ import ( "github.com/jesseduffield/lazygit/pkg/integration/tests/interactive_rebase" "github.com/jesseduffield/lazygit/pkg/integration/tests/misc" "github.com/jesseduffield/lazygit/pkg/integration/tests/stash" + "github.com/jesseduffield/lazygit/pkg/integration/tests/sync" ) // Here is where we lists the actual tests that will run. When you create a new test, @@ -64,6 +65,7 @@ var tests = []*components.IntegrationTest{ diff.Diff, diff.DiffAndApplyPatch, diff.DiffCommits, + sync.FetchPrune, } func GetTests() []*components.IntegrationTest { diff --git a/test/integration/fetchPrune/config/config.yml b/test/integration/fetchPrune/config/config.yml deleted file mode 100644 index a77fb48ed..000000000 --- a/test/integration/fetchPrune/config/config.yml +++ /dev/null @@ -1,10 +0,0 @@ -disableStartupPopups: true -git: - autoFetch: false -gui: - theme: - activeBorderColor: - - green - - bold - SelectedRangeBgcolor: - - reverse diff --git a/test/integration/fetchPrune/expected/origin/HEAD b/test/integration/fetchPrune/expected/origin/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/fetchPrune/expected/origin/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/fetchPrune/expected/origin/config b/test/integration/fetchPrune/expected/origin/config deleted file mode 100644 index 4caf7663f..000000000 --- a/test/integration/fetchPrune/expected/origin/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/fetchPrune/actual/./repo diff --git a/test/integration/fetchPrune/expected/origin/description b/test/integration/fetchPrune/expected/origin/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/fetchPrune/expected/origin/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/fetchPrune/expected/origin/info/exclude b/test/integration/fetchPrune/expected/origin/info/exclude deleted file mode 100644 index 8e9f2071f..000000000 --- a/test/integration/fetchPrune/expected/origin/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/fetchPrune/expected/origin/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/fetchPrune/expected/origin/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmb`~^A08nuUMF0Q* diff --git a/test/integration/fetchPrune/expected/origin/packed-refs b/test/integration/fetchPrune/expected/origin/packed-refs deleted file mode 100644 index 37e4528a7..000000000 --- a/test/integration/fetchPrune/expected/origin/packed-refs +++ /dev/null @@ -1,2 +0,0 @@ -# pack-refs with: peeled fully-peeled sorted -75f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 refs/heads/master diff --git a/test/integration/fetchPrune/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/fetchPrune/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 3829ab872..000000000 --- a/test/integration/fetchPrune/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -myfile1 diff --git a/test/integration/fetchPrune/expected/repo/.git_keep/FETCH_HEAD b/test/integration/fetchPrune/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index 800c8511d..000000000 --- a/test/integration/fetchPrune/expected/repo/.git_keep/FETCH_HEAD +++ /dev/null @@ -1 +0,0 @@ -75f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 branch 'master' of ../origin diff --git a/test/integration/fetchPrune/expected/repo/.git_keep/HEAD b/test/integration/fetchPrune/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/fetchPrune/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/fetchPrune/expected/repo/.git_keep/config b/test/integration/fetchPrune/expected/repo/.git_keep/config deleted file mode 100644 index 957eae48a..000000000 --- a/test/integration/fetchPrune/expected/repo/.git_keep/config +++ /dev/null @@ -1,21 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true -[user] - email = CI@example.com - name = CI -[fetch] - prune = true -[remote "origin"] - url = ../origin - fetch = +refs/heads/*:refs/remotes/origin/* -[branch "master"] - remote = origin - merge = refs/heads/master -[branch "other_branch"] - remote = origin - merge = refs/heads/other_branch diff --git a/test/integration/fetchPrune/expected/repo/.git_keep/description b/test/integration/fetchPrune/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/fetchPrune/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/fetchPrune/expected/repo/.git_keep/index b/test/integration/fetchPrune/expected/repo/.git_keep/index deleted file mode 100644 index 6955ab1975627f52285cfaecbc4504c38ef8f683..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 137 zcmZ?q402{*U|<4b#w7c@KgB<)=fY@41_oB9`TAQJ7#f!VrN08zhyXF$(mjv=s;1uf z5)m53lkapPz^kSEDg%3NWm;xVsv%H8NRX>5kdkCDR50M;%lWWu`@CM4hix~67Jm13 ezUIFs$a?WXj)}WPHW;lf=NGkSYB`!vvIzj1Y%f;; diff --git a/test/integration/fetchPrune/expected/repo/.git_keep/info/exclude b/test/integration/fetchPrune/expected/repo/.git_keep/info/exclude deleted file mode 100644 index 8e9f2071f..000000000 --- a/test/integration/fetchPrune/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/fetchPrune/expected/repo/.git_keep/logs/HEAD b/test/integration/fetchPrune/expected/repo/.git_keep/logs/HEAD deleted file mode 100644 index 639cde24f..000000000 --- a/test/integration/fetchPrune/expected/repo/.git_keep/logs/HEAD +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 75f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 CI 1648352761 +1100 commit (initial): myfile1 -75f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 75f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 CI 1648352761 +1100 checkout: moving from master to other_branch -75f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 75f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 CI 1648352761 +1100 checkout: moving from other_branch to master diff --git a/test/integration/fetchPrune/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/fetchPrune/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index f44229efe..000000000 --- a/test/integration/fetchPrune/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 75f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 CI 1648352761 +1100 commit (initial): myfile1 diff --git a/test/integration/fetchPrune/expected/repo/.git_keep/logs/refs/heads/other_branch b/test/integration/fetchPrune/expected/repo/.git_keep/logs/refs/heads/other_branch deleted file mode 100644 index 01e383d7f..000000000 --- a/test/integration/fetchPrune/expected/repo/.git_keep/logs/refs/heads/other_branch +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 75f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 CI 1648352761 +1100 branch: Created from HEAD diff --git a/test/integration/fetchPrune/expected/repo/.git_keep/logs/refs/remotes/origin/master b/test/integration/fetchPrune/expected/repo/.git_keep/logs/refs/remotes/origin/master deleted file mode 100644 index 7fe249171..000000000 --- a/test/integration/fetchPrune/expected/repo/.git_keep/logs/refs/remotes/origin/master +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 75f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 CI 1648352761 +1100 fetch origin: storing head diff --git a/test/integration/fetchPrune/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/fetchPrune/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmb`~^A08nuUMF0Q* diff --git a/test/integration/fetchPrune/expected/repo/.git_keep/packed-refs b/test/integration/fetchPrune/expected/repo/.git_keep/packed-refs deleted file mode 100644 index 250f18738..000000000 --- a/test/integration/fetchPrune/expected/repo/.git_keep/packed-refs +++ /dev/null @@ -1 +0,0 @@ -# pack-refs with: peeled fully-peeled sorted diff --git a/test/integration/fetchPrune/expected/repo/.git_keep/refs/heads/master b/test/integration/fetchPrune/expected/repo/.git_keep/refs/heads/master deleted file mode 100644 index 817ade7eb..000000000 --- a/test/integration/fetchPrune/expected/repo/.git_keep/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -75f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 diff --git a/test/integration/fetchPrune/expected/repo/.git_keep/refs/heads/other_branch b/test/integration/fetchPrune/expected/repo/.git_keep/refs/heads/other_branch deleted file mode 100644 index 817ade7eb..000000000 --- a/test/integration/fetchPrune/expected/repo/.git_keep/refs/heads/other_branch +++ /dev/null @@ -1 +0,0 @@ -75f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 diff --git a/test/integration/fetchPrune/expected/repo/.git_keep/refs/remotes/origin/master b/test/integration/fetchPrune/expected/repo/.git_keep/refs/remotes/origin/master deleted file mode 100644 index 817ade7eb..000000000 --- a/test/integration/fetchPrune/expected/repo/.git_keep/refs/remotes/origin/master +++ /dev/null @@ -1 +0,0 @@ -75f37fc5ae7e9967e9833b66beb2c9ee2f9f6c27 diff --git a/test/integration/fetchPrune/expected/repo/myfile1 b/test/integration/fetchPrune/expected/repo/myfile1 deleted file mode 100644 index a5bce3fd2..000000000 --- a/test/integration/fetchPrune/expected/repo/myfile1 +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/test/integration/fetchPrune/recording.json b/test/integration/fetchPrune/recording.json deleted file mode 100644 index b24cbf0cb..000000000 --- a/test/integration/fetchPrune/recording.json +++ /dev/null @@ -1 +0,0 @@ -{"KeyEvents":[{"Timestamp":608,"Mod":0,"Key":256,"Ch":102},{"Timestamp":1568,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]} \ No newline at end of file diff --git a/test/integration/fetchPrune/setup.sh b/test/integration/fetchPrune/setup.sh deleted file mode 100644 index 87829a2e3..000000000 --- a/test/integration/fetchPrune/setup.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -set -e - -cd $1 - -git init - -git config user.email "CI@example.com" -git config user.name "CI" - -# we're setting this to ensure that it's honoured by the fetch command -git config fetch.prune true - -echo test1 > myfile1 -git add . -git commit -am "myfile1" - -git checkout -b other_branch -git checkout master - -cd .. -git clone --bare ./repo origin - -cd repo - -git remote add origin ../origin -git fetch origin -git branch --set-upstream-to=origin/master master -git branch --set-upstream-to=origin/other_branch other_branch - -# unbenownst to our test repo we're removing the branch on the remote, so upon -# fetching with prune: true we expect git to realise the remote branch is gone -git -C ../origin branch -d other_branch diff --git a/test/integration/fetchPrune/test.json b/test/integration/fetchPrune/test.json deleted file mode 100644 index 3d696e153..000000000 --- a/test/integration/fetchPrune/test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "description": "fetch from the remote with the 'prune' option set in the git config. Note this has a false positive until we find a way to show ls-remote origin in all tests when creating snapshots.", - "speed": 10 -} From 6f709456fed527d0633aba72be44363581e19a48 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 28 Dec 2022 17:52:04 +1100 Subject: [PATCH 3/6] migrate test for rename branch and pull --- pkg/integration/components/shell.go | 6 ++ .../tests/sync/rename_branch_and_pull.go | 57 ++++++++++++++++++ pkg/integration/tests/tests.go | 1 + .../expected/origin/HEAD | 1 - .../expected/origin/config | 6 -- .../expected/origin/description | 1 - .../expected/origin/info/exclude | 6 -- .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../12/d38e54cd419303587ba4613fb1194ec5c9d04f | Bin 149 -> 0 bytes .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../2b/173c861df433fa43ffad13f80c8b312c5c8bce | Bin 103 -> 0 bytes .../2f/6174050380438f14b16658a356e762435ca591 | Bin 128 -> 0 bytes .../3e/5a250f3b6d2ea4ea93b3006aaceeb75bb8d0b6 | 3 - .../72/ee6cc86de71389b9c70e24c7d8c8837e7d3566 | 2 - .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../a7/341a59f0ddeef969e69fb6368266d22b0f2416 | Bin 77 -> 0 bytes .../b0/90d7f0029e74de260f7458721b8edd1e618edc | Bin 149 -> 0 bytes .../d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 | Bin 21 -> 0 bytes .../df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b | Bin 21 -> 0 bytes .../expected/origin/packed-refs | 2 - .../expected/repo/.git_keep/COMMIT_EDITMSG | 1 - .../expected/repo/.git_keep/FETCH_HEAD | 1 - .../expected/repo/.git_keep/HEAD | 1 - .../expected/repo/.git_keep/ORIG_HEAD | 1 - .../expected/repo/.git_keep/config | 14 ----- .../expected/repo/.git_keep/description | 1 - .../expected/repo/.git_keep/index | Bin 353 -> 0 bytes .../expected/repo/.git_keep/info/exclude | 6 -- .../expected/repo/.git_keep/logs/HEAD | 8 --- .../.git_keep/logs/refs/heads/master-local | 7 --- .../.git_keep/logs/refs/remotes/origin/master | 1 - .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../12/d38e54cd419303587ba4613fb1194ec5c9d04f | Bin 149 -> 0 bytes .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../2b/173c861df433fa43ffad13f80c8b312c5c8bce | Bin 103 -> 0 bytes .../2f/6174050380438f14b16658a356e762435ca591 | Bin 128 -> 0 bytes .../3e/5a250f3b6d2ea4ea93b3006aaceeb75bb8d0b6 | 3 - .../72/ee6cc86de71389b9c70e24c7d8c8837e7d3566 | 2 - .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../a7/341a59f0ddeef969e69fb6368266d22b0f2416 | Bin 77 -> 0 bytes .../b0/90d7f0029e74de260f7458721b8edd1e618edc | Bin 149 -> 0 bytes .../d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 | Bin 21 -> 0 bytes .../df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b | Bin 21 -> 0 bytes .../repo/.git_keep/refs/heads/master-local | 1 - .../repo/.git_keep/refs/remotes/origin/master | 1 - .../expected/repo/myfile1 | 1 - .../expected/repo/myfile2 | 1 - .../expected/repo/myfile3 | 1 - .../expected/repo/myfile4 | 1 - .../recording.json | 1 - .../setup.sh | 36 ----------- .../test.json | 1 - 52 files changed, 64 insertions(+), 111 deletions(-) create mode 100644 pkg/integration/tests/sync/rename_branch_and_pull.go delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/HEAD delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/config delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/description delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/info/exclude delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/12/d38e54cd419303587ba4613fb1194ec5c9d04f delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/2b/173c861df433fa43ffad13f80c8b312c5c8bce delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/2f/6174050380438f14b16658a356e762435ca591 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/3e/5a250f3b6d2ea4ea93b3006aaceeb75bb8d0b6 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/72/ee6cc86de71389b9c70e24c7d8c8837e7d3566 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/b0/90d7f0029e74de260f7458721b8edd1e618edc delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/packed-refs delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/COMMIT_EDITMSG delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/FETCH_HEAD delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/HEAD delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/ORIG_HEAD delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/config delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/description delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/index delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/info/exclude delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/logs/HEAD delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/logs/refs/heads/master-local delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/logs/refs/remotes/origin/master delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/12/d38e54cd419303587ba4613fb1194ec5c9d04f delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/2b/173c861df433fa43ffad13f80c8b312c5c8bce delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/2f/6174050380438f14b16658a356e762435ca591 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/3e/5a250f3b6d2ea4ea93b3006aaceeb75bb8d0b6 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/72/ee6cc86de71389b9c70e24c7d8c8837e7d3566 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/b0/90d7f0029e74de260f7458721b8edd1e618edc delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/refs/heads/master-local delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/refs/remotes/origin/master delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile1 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile2 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile3 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile4 delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/recording.json delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/setup.sh delete mode 100644 test/integration/fetchRemoteBranchWithNonmatchingName/test.json diff --git a/pkg/integration/components/shell.go b/pkg/integration/components/shell.go index bfd1c5f86..9b7beca7c 100644 --- a/pkg/integration/components/shell.go +++ b/pkg/integration/components/shell.go @@ -193,3 +193,9 @@ func (self *Shell) RemoveRemoteBranch(remoteName string, branch string) *Shell { return self } + +func (self *Shell) HardReset(ref string) *Shell { + self.RunCommand(fmt.Sprintf("git reset --hard %s", ref)) + + return self +} diff --git a/pkg/integration/tests/sync/rename_branch_and_pull.go b/pkg/integration/tests/sync/rename_branch_and_pull.go new file mode 100644 index 000000000..93e28dfc3 --- /dev/null +++ b/pkg/integration/tests/sync/rename_branch_and_pull.go @@ -0,0 +1,57 @@ +package sync + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var RenameBranchAndPull = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Rename a branch to no longer match its upstream, then pull from the upstream", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(config *config.AppConfig) { + config.UserConfig.Git.AutoFetch = false + }, + SetupRepo: func(shell *Shell) { + shell.EmptyCommit("one") + shell.EmptyCommit("two") + + shell.CloneIntoRemote("origin") + shell.SetBranchUpstream("master", "origin/master") + + // remove the 'two' commit so that we have something to pull from the remote + shell.HardReset("HEAD^") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Commits(). + Lines( + Contains("one"), + ) + + t.Views().Branches(). + Focus(). + Lines( + Contains("master"), + ). + Press(keys.Branches.RenameBranch). + Tap(func() { + t.ExpectPopup().Confirmation(). + Title(Equals("rename branch")). + Content(Equals("This branch is tracking a remote. This action will only rename the local branch name, not the name of the remote branch. Continue?")). + Confirm() + + t.ExpectPopup().Prompt(). + Title(Contains("Enter new branch name")). + InitialText(Equals("master")). + Type("-local"). + Confirm() + }). + Press(keys.Universal.PullFiles) + + t.Views().Commits(). + Lines( + Contains("two"), + Contains("one"), + ) + }, +}) diff --git a/pkg/integration/tests/tests.go b/pkg/integration/tests/tests.go index 8a6c52565..bba5f38e3 100644 --- a/pkg/integration/tests/tests.go +++ b/pkg/integration/tests/tests.go @@ -66,6 +66,7 @@ var tests = []*components.IntegrationTest{ diff.DiffAndApplyPatch, diff.DiffCommits, sync.FetchPrune, + sync.RenameBranchAndPull, } func GetTests() []*components.IntegrationTest { diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/HEAD b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/config b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/config deleted file mode 100644 index ccf112f58..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/config +++ /dev/null @@ -1,6 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = true -[remote "origin"] - url = /home/mark/Downloads/gits/lazygit/test/integration/fetchRemoteBranchWithNonmatchingName/actual/./repo diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/description b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/info/exclude b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/info/exclude +++ /dev/null @@ -1,6 +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] -# *~ diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmbAt4cxg9aiNnE>sQ zYCn^*k#~EnyB$V*9mYF8Qnx2A(^_xVaf*)m*kyYrPh<{yOf~$OoBA!w6W;s)E5bVh DYmG%8 diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 deleted file mode 100644 index f74bf2335bbc5999ad0faff94fb04165d8ab5c7d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb~ZE#08nZNMgRZ+ diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/2b/173c861df433fa43ffad13f80c8b312c5c8bce b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/2b/173c861df433fa43ffad13f80c8b312c5c8bce deleted file mode 100644 index 0a734f98100d24e67455a3cfa8497adaccc7a422..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 103 zcmV-t0GR)H0V^p=O;s>7Fl8__FfcPQQOK=K%gjkNWLUcA@n6-{8($(qqj>V2E(CbB zbYDeLV#FZ9^TVh?Y2Ue*s}_Y<^|!pzo^PR!qQsctem1Z6nX+eZ_)jSuQWx;@*VuJL J8UTCqE3ZN5G4lWb diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/2f/6174050380438f14b16658a356e762435ca591 b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/2f/6174050380438f14b16658a356e762435ca591 deleted file mode 100644 index 31ae3f5ba89b96ad2e268134913bd913a0bc46d9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmV-`0Du2@0V^p=O;s>7F<>w>FfcPQQOK=K%gjkNWLUcA@n6-{8($(qqj>V2E(CbB zbYDeLV#FZ9^TVh?Y2Ue*s}_Y<^|!pzo^PR!qQsctem1Z6nX+eZ_)jSuQWx;@*VuJL i8byf-!zGiW55oT$9V>g4{^GR7m!#NRuR{Q5NjxpS$UUzB diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/3e/5a250f3b6d2ea4ea93b3006aaceeb75bb8d0b6 b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/3e/5a250f3b6d2ea4ea93b3006aaceeb75bb8d0b6 deleted file mode 100644 index 0b97b6ff4..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/3e/5a250f3b6d2ea4ea93b3006aaceeb75bb8d0b6 +++ /dev/null @@ -1,3 +0,0 @@ -xA -0@Q9I -"BW=FL!R"~r*Jd ¬DjE`~^A08nuUMF0Q* diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/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/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/b0/90d7f0029e74de260f7458721b8edd1e618edc b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/b0/90d7f0029e74de260f7458721b8edd1e618edc deleted file mode 100644 index 1862ebd3c3feafed14da69f01a205eedeea79ac1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 149 zcmV;G0BZku0gaA93c@fD06pgwxeKzJY<4#wBJ|W}#B_^-v86=N-`gj69cEza(%PeY z%yj6RnGZ9g5G05S6m>?rA#>6a6Ps|Lm}*HG-C8z#buYn;YgL|1FlxT#Dqw-COj=c= zm`r=huDttw+59m2^DtiRQ`-8pQ(fA{BPT*olI)KV0NhUZscwJju6^gn)5!e**OWNK DU$IK2 diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 deleted file mode 100644 index d39fa7d2fecf1c45a132dfe3a8758952f3c8d968..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb}lpN08nuUO8@`> diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b deleted file mode 100644 index 9b771fc2f6f41f91b00976b4ff3f8f9935f7931e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb>`CU&08otwO#lD@ diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/packed-refs b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/packed-refs deleted file mode 100644 index 19e0f32e9..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/origin/packed-refs +++ /dev/null @@ -1,2 +0,0 @@ -# pack-refs with: peeled fully-peeled sorted -b090d7f0029e74de260f7458721b8edd1e618edc refs/heads/master diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 51be8ec3d..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -myfile4 diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/FETCH_HEAD b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index 09935c2a5..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/FETCH_HEAD +++ /dev/null @@ -1 +0,0 @@ -b090d7f0029e74de260f7458721b8edd1e618edc branch 'master' of ../origin diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/HEAD b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/HEAD deleted file mode 100644 index 416a3a6d6..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master-local diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/ORIG_HEAD b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/ORIG_HEAD deleted file mode 100644 index 2aae46d33..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -12d38e54cd419303587ba4613fb1194ec5c9d04f diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/config b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/config deleted file mode 100644 index 4e08dfbfc..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/config +++ /dev/null @@ -1,14 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true -[user] - email = CI@example.com - name = CI -[remote "origin"] - url = ../origin - fetch = +refs/heads/*:refs/remotes/origin/* -[branch "master-local"] - remote = origin - merge = refs/heads/master diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/description b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/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/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/index b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/index deleted file mode 100644 index 3dd3930219a8ba5d7e12b178a303ad098141b955..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 353 zcmZ?q402{*U|<4bmZa$$?HOyge}K_IF)2ppat;QD#w834%r79AfoNzBgzMnlb!LN`Z(=Z8^)(!O&qS1k&!>Th|a zJ>NndW{wfW94D(6YnK4c0n<=(`q9m~pUta%rtH}p{!?G7=Nxy7gBXcs0qGizdaCII0-cB=pY diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/info/exclude b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/info/exclude +++ /dev/null @@ -1,6 +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] -# *~ diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/logs/HEAD b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/logs/HEAD deleted file mode 100644 index 3972ae2a1..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/logs/HEAD +++ /dev/null @@ -1,8 +0,0 @@ -0000000000000000000000000000000000000000 3e5a250f3b6d2ea4ea93b3006aaceeb75bb8d0b6 CI 1654108479 +0200 commit (initial): myfile1 -3e5a250f3b6d2ea4ea93b3006aaceeb75bb8d0b6 12d38e54cd419303587ba4613fb1194ec5c9d04f CI 1654108479 +0200 commit: myfile2 -12d38e54cd419303587ba4613fb1194ec5c9d04f 72ee6cc86de71389b9c70e24c7d8c8837e7d3566 CI 1654108479 +0200 commit: myfile3 -72ee6cc86de71389b9c70e24c7d8c8837e7d3566 b090d7f0029e74de260f7458721b8edd1e618edc CI 1654108479 +0200 commit: myfile4 -b090d7f0029e74de260f7458721b8edd1e618edc 12d38e54cd419303587ba4613fb1194ec5c9d04f CI 1654108479 +0200 reset: moving to HEAD~2 -12d38e54cd419303587ba4613fb1194ec5c9d04f 0000000000000000000000000000000000000000 CI 1654108482 +0200 Branch: renamed refs/heads/master to refs/heads/master-local -0000000000000000000000000000000000000000 12d38e54cd419303587ba4613fb1194ec5c9d04f CI 1654108482 +0200 Branch: renamed refs/heads/master to refs/heads/master-local -12d38e54cd419303587ba4613fb1194ec5c9d04f b090d7f0029e74de260f7458721b8edd1e618edc CI 1654108482 +0200 pull --no-edit --ff-only origin master: Fast-forward diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/logs/refs/heads/master-local b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/logs/refs/heads/master-local deleted file mode 100644 index b930bd5b6..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/logs/refs/heads/master-local +++ /dev/null @@ -1,7 +0,0 @@ -0000000000000000000000000000000000000000 3e5a250f3b6d2ea4ea93b3006aaceeb75bb8d0b6 CI 1654108479 +0200 commit (initial): myfile1 -3e5a250f3b6d2ea4ea93b3006aaceeb75bb8d0b6 12d38e54cd419303587ba4613fb1194ec5c9d04f CI 1654108479 +0200 commit: myfile2 -12d38e54cd419303587ba4613fb1194ec5c9d04f 72ee6cc86de71389b9c70e24c7d8c8837e7d3566 CI 1654108479 +0200 commit: myfile3 -72ee6cc86de71389b9c70e24c7d8c8837e7d3566 b090d7f0029e74de260f7458721b8edd1e618edc CI 1654108479 +0200 commit: myfile4 -b090d7f0029e74de260f7458721b8edd1e618edc 12d38e54cd419303587ba4613fb1194ec5c9d04f CI 1654108479 +0200 reset: moving to HEAD~2 -12d38e54cd419303587ba4613fb1194ec5c9d04f 12d38e54cd419303587ba4613fb1194ec5c9d04f CI 1654108482 +0200 Branch: renamed refs/heads/master to refs/heads/master-local -12d38e54cd419303587ba4613fb1194ec5c9d04f b090d7f0029e74de260f7458721b8edd1e618edc CI 1654108482 +0200 pull --no-edit --ff-only origin master: Fast-forward diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/logs/refs/remotes/origin/master b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/logs/refs/remotes/origin/master deleted file mode 100644 index 3cb40d7d3..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/logs/refs/remotes/origin/master +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 b090d7f0029e74de260f7458721b8edd1e618edc CI 1654108479 +0200 fetch origin: storing head diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmbAt4cxg9aiNnE>sQ zYCn^*k#~EnyB$V*9mYF8Qnx2A(^_xVaf*)m*kyYrPh<{yOf~$OoBA!w6W;s)E5bVh DYmG%8 diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 deleted file mode 100644 index f74bf2335bbc5999ad0faff94fb04165d8ab5c7d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb~ZE#08nZNMgRZ+ diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/2b/173c861df433fa43ffad13f80c8b312c5c8bce b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/2b/173c861df433fa43ffad13f80c8b312c5c8bce deleted file mode 100644 index 0a734f98100d24e67455a3cfa8497adaccc7a422..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 103 zcmV-t0GR)H0V^p=O;s>7Fl8__FfcPQQOK=K%gjkNWLUcA@n6-{8($(qqj>V2E(CbB zbYDeLV#FZ9^TVh?Y2Ue*s}_Y<^|!pzo^PR!qQsctem1Z6nX+eZ_)jSuQWx;@*VuJL J8UTCqE3ZN5G4lWb diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/2f/6174050380438f14b16658a356e762435ca591 b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/2f/6174050380438f14b16658a356e762435ca591 deleted file mode 100644 index 31ae3f5ba89b96ad2e268134913bd913a0bc46d9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmV-`0Du2@0V^p=O;s>7F<>w>FfcPQQOK=K%gjkNWLUcA@n6-{8($(qqj>V2E(CbB zbYDeLV#FZ9^TVh?Y2Ue*s}_Y<^|!pzo^PR!qQsctem1Z6nX+eZ_)jSuQWx;@*VuJL i8byf-!zGiW55oT$9V>g4{^GR7m!#NRuR{Q5NjxpS$UUzB diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/3e/5a250f3b6d2ea4ea93b3006aaceeb75bb8d0b6 b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/3e/5a250f3b6d2ea4ea93b3006aaceeb75bb8d0b6 deleted file mode 100644 index 0b97b6ff4..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/3e/5a250f3b6d2ea4ea93b3006aaceeb75bb8d0b6 +++ /dev/null @@ -1,3 +0,0 @@ -xA -0@Q9I -"BW=FL!R"~r*Jd ¬DjE`~^A08nuUMF0Q* diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/a7/341a59f0ddeef969e69fb6368266d22b0f2416 b/test/integration/fetchRemoteBranchWithNonmatchingName/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/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/b0/90d7f0029e74de260f7458721b8edd1e618edc b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/b0/90d7f0029e74de260f7458721b8edd1e618edc deleted file mode 100644 index 1862ebd3c3feafed14da69f01a205eedeea79ac1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 149 zcmV;G0BZku0gaA93c@fD06pgwxeKzJY<4#wBJ|W}#B_^-v86=N-`gj69cEza(%PeY z%yj6RnGZ9g5G05S6m>?rA#>6a6Ps|Lm}*HG-C8z#buYn;YgL|1FlxT#Dqw-COj=c= zm`r=huDttw+59m2^DtiRQ`-8pQ(fA{BPT*olI)KV0NhUZscwJju6^gn)5!e**OWNK DU$IK2 diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 deleted file mode 100644 index d39fa7d2fecf1c45a132dfe3a8758952f3c8d968..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb}lpN08nuUO8@`> diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b deleted file mode 100644 index 9b771fc2f6f41f91b00976b4ff3f8f9935f7931e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb>`CU&08otwO#lD@ diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/refs/heads/master-local b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/refs/heads/master-local deleted file mode 100644 index 22e32850e..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/refs/heads/master-local +++ /dev/null @@ -1 +0,0 @@ -b090d7f0029e74de260f7458721b8edd1e618edc diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/refs/remotes/origin/master b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/refs/remotes/origin/master deleted file mode 100644 index 22e32850e..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/.git_keep/refs/remotes/origin/master +++ /dev/null @@ -1 +0,0 @@ -b090d7f0029e74de260f7458721b8edd1e618edc diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile1 b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile1 deleted file mode 100644 index a5bce3fd2..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile1 +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile2 b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile2 deleted file mode 100644 index 180cf8328..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile2 +++ /dev/null @@ -1 +0,0 @@ -test2 diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile3 b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile3 deleted file mode 100644 index df6b0d2bc..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile3 +++ /dev/null @@ -1 +0,0 @@ -test3 diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile4 b/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile4 deleted file mode 100644 index d234c5e05..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/expected/repo/myfile4 +++ /dev/null @@ -1 +0,0 @@ -test4 diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/recording.json b/test/integration/fetchRemoteBranchWithNonmatchingName/recording.json deleted file mode 100644 index eea17dc8d..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/recording.json +++ /dev/null @@ -1 +0,0 @@ -{"KeyEvents":[{"Timestamp":703,"Mod":0,"Key":256,"Ch":108},{"Timestamp":1151,"Mod":0,"Key":256,"Ch":82},{"Timestamp":1692,"Mod":0,"Key":13,"Ch":13},{"Timestamp":2183,"Mod":0,"Key":256,"Ch":45},{"Timestamp":2372,"Mod":0,"Key":256,"Ch":108},{"Timestamp":2498,"Mod":0,"Key":256,"Ch":111},{"Timestamp":2617,"Mod":0,"Key":256,"Ch":99},{"Timestamp":2663,"Mod":0,"Key":256,"Ch":97},{"Timestamp":2724,"Mod":0,"Key":256,"Ch":108},{"Timestamp":3196,"Mod":0,"Key":13,"Ch":13},{"Timestamp":3837,"Mod":0,"Key":256,"Ch":102},{"Timestamp":4854,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":213,"Height":56}]} \ No newline at end of file diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/setup.sh b/test/integration/fetchRemoteBranchWithNonmatchingName/setup.sh deleted file mode 100644 index bd33f9f6d..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/setup.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -set -e - -set -e - -cd $1 - -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 test3 > myfile3 -git add . -git commit -am "myfile3" -echo test4 > myfile4 -git add . -git commit -am "myfile4" - -cd .. -git clone --bare ./repo origin - -cd repo - -git reset --hard HEAD~2 -git remote add origin ../origin -git fetch origin -git branch --set-upstream-to=origin/master - diff --git a/test/integration/fetchRemoteBranchWithNonmatchingName/test.json b/test/integration/fetchRemoteBranchWithNonmatchingName/test.json deleted file mode 100644 index dffe129cd..000000000 --- a/test/integration/fetchRemoteBranchWithNonmatchingName/test.json +++ /dev/null @@ -1 +0,0 @@ -{ "description": "allow unsetting the upstream of the current branch", "speed": 10 } From 89ba3a38b49274b39c3772dd7ebcd13b307e3932 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 28 Dec 2022 18:17:28 +1100 Subject: [PATCH 4/6] migrate filter path tests --- pkg/integration/tests/filter_by_path/cli.go | 20 +++++ .../tests/filter_by_path/select_file.go | 76 ++++++++++++++++++ .../tests/filter_by_path/type_file.go | 35 ++++++++ pkg/integration/tests/tests.go | 4 + .../expected/repo/.git_keep/COMMIT_EDITMSG | 1 - .../expected/repo/.git_keep/FETCH_HEAD | 0 .../filterPath/expected/repo/.git_keep/HEAD | 1 - .../filterPath/expected/repo/.git_keep/config | 10 --- .../expected/repo/.git_keep/description | 1 - .../filterPath/expected/repo/.git_keep/index | Bin 281 -> 0 bytes .../expected/repo/.git_keep/info/exclude | 7 -- .../expected/repo/.git_keep/logs/HEAD | 7 -- .../repo/.git_keep/logs/refs/heads/master | 7 -- .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 | Bin 50 -> 0 bytes .../22/adc4567aba3d1a0acf28b4cef312922d516aeb | Bin 146 -> 0 bytes .../2e/a97a56215f6adbe991eaf0dcf61c7086880ea5 | Bin 126 -> 0 bytes .../38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da | Bin 21 -> 0 bytes .../4b/9d1f9f9fc76b123a5c90cd8396390cac41a3e3 | Bin 148 -> 0 bytes .../77/9de836a10ac879fa919f48d5dc4f4ce11528e2 | Bin 101 -> 0 bytes .../84/b823dc5fc92fcf08eb8c8545716232ce49bd45 | Bin 106 -> 0 bytes .../8b/476a1094290d7251c56305e199eb2a203d8682 | Bin 146 -> 0 bytes .../9e/88a70dc8d82dd2afbfd50176ef78e18823bc2c | Bin 101 -> 0 bytes .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../af/3ef564e968dbe92fb4e08a67dd5f835f43d4e8 | Bin 145 -> 0 bytes .../b7/c728d5b4e9dfc210ec19f0549f25c94b766e4e | Bin 100 -> 0 bytes .../d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 | 2 - .../d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 | Bin 21 -> 0 bytes .../d7/236d5f85ad303f5f23141661e4c8959610b70b | 2 - .../df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b | Bin 21 -> 0 bytes .../f2/4812da035a21812bc4c73018349ac2f0a6ec39 | 2 - .../f3/d94fa1d4be39b8daae35b82525bf357aa712de | Bin 118 -> 0 bytes .../expected/repo/.git_keep/refs/heads/master | 1 - .../integration/filterPath/expected/repo/file | 1 - .../filterPath/expected/repo/file0 | 1 - .../filterPath/expected/repo/file2 | 1 - test/integration/filterPath/recording.json | 1 - test/integration/filterPath/setup.sh | 33 -------- test/integration/filterPath/test.json | 1 - .../expected/repo/.git_keep/COMMIT_EDITMSG | 1 - .../expected/repo/.git_keep/FETCH_HEAD | 0 .../filterPath2/expected/repo/.git_keep/HEAD | 1 - .../expected/repo/.git_keep/config | 10 --- .../expected/repo/.git_keep/description | 1 - .../filterPath2/expected/repo/.git_keep/index | Bin 353 -> 0 bytes .../expected/repo/.git_keep/info/exclude | 7 -- .../expected/repo/.git_keep/logs/HEAD | 6 -- .../repo/.git_keep/logs/refs/heads/master | 6 -- .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 | Bin 50 -> 0 bytes .../38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da | Bin 21 -> 0 bytes .../6c/dce80c062ba2c8f8758879834a936b84ead78c | Bin 147 -> 0 bytes .../70/3f7069185227287623aaba7cdb0e56ae7a6c60 | Bin 118 -> 0 bytes .../77/9de836a10ac879fa919f48d5dc4f4ce11528e2 | Bin 101 -> 0 bytes .../84/b823dc5fc92fcf08eb8c8545716232ce49bd45 | Bin 106 -> 0 bytes .../92/ec47058a2894afbbbd69c5f79bff20c503e686 | Bin 147 -> 0 bytes .../9e/88a70dc8d82dd2afbfd50176ef78e18823bc2c | Bin 101 -> 0 bytes .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../a5/c053a7a46bce2775edb371a9aa97424b542ab7 | Bin 148 -> 0 bytes .../c5/f9a8793f15aa0db816944424adb4303eb036a8 | 2 - .../c8/68546458601b9c71b76b893f9020ecf7405528 | Bin 106 -> 0 bytes .../d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 | 2 - .../d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 | Bin 21 -> 0 bytes .../df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b | Bin 21 -> 0 bytes .../e7/c2bd00356720683d5bc4362ef5b92655fa8914 | 3 - .../expected/repo/.git_keep/refs/heads/master | 1 - .../filterPath2/expected/repo/file | 1 - .../filterPath2/expected/repo/file0 | 1 - .../filterPath2/expected/repo/file1 | 1 - .../filterPath2/expected/repo/file2 | 1 - test/integration/filterPath2/recording.json | 1 - test/integration/filterPath2/setup.sh | 33 -------- test/integration/filterPath2/test.json | 1 - .../expected/repo/.git_keep/COMMIT_EDITMSG | 1 - .../expected/repo/.git_keep/FETCH_HEAD | 0 .../filterPath3/expected/repo/.git_keep/HEAD | 1 - .../expected/repo/.git_keep/config | 10 --- .../expected/repo/.git_keep/description | 1 - .../filterPath3/expected/repo/.git_keep/index | Bin 353 -> 0 bytes .../expected/repo/.git_keep/info/exclude | 7 -- .../expected/repo/.git_keep/logs/HEAD | 6 -- .../repo/.git_keep/logs/refs/heads/master | 6 -- .../18/0cf8328022becee9aaa2577a8f84ea2b9f3827 | Bin 21 -> 0 bytes .../1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 | Bin 50 -> 0 bytes .../23/1410172e8f51138f06d8dff963898fb1e97b30 | Bin 147 -> 0 bytes .../38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da | Bin 21 -> 0 bytes .../72/226d27a85fff688d32c134a22ebe650d6c2e41 | Bin 148 -> 0 bytes .../77/9de836a10ac879fa919f48d5dc4f4ce11528e2 | Bin 101 -> 0 bytes .../84/b823dc5fc92fcf08eb8c8545716232ce49bd45 | Bin 106 -> 0 bytes .../8e/d4f7b4eae8cc97d9add459348cc95e936b8f25 | 2 - .../9e/88a70dc8d82dd2afbfd50176ef78e18823bc2c | Bin 101 -> 0 bytes .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../b3/5d7fa77c939890020952987eeb461f410297d8 | 3 - .../c1/a1ba9d2873d7163606bb5fdf46e50975db042b | 3 - .../c8/68546458601b9c71b76b893f9020ecf7405528 | Bin 106 -> 0 bytes .../d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 | 2 - .../d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 | Bin 21 -> 0 bytes .../db/6681a3e9fb9fb6ef524771cdc763904dd2b54d | 3 - .../df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b | Bin 21 -> 0 bytes .../expected/repo/.git_keep/refs/heads/master | 1 - .../filterPath3/expected/repo/file | 1 - .../filterPath3/expected/repo/file0 | 1 - .../filterPath3/expected/repo/file1 | 1 - .../filterPath3/expected/repo/file2 | 1 - test/integration/filterPath3/recording.json | 1 - test/integration/filterPath3/setup.sh | 33 -------- test/integration/filterPath3/test.json | 1 - 107 files changed, 135 insertions(+), 243 deletions(-) create mode 100644 pkg/integration/tests/filter_by_path/cli.go create mode 100644 pkg/integration/tests/filter_by_path/select_file.go create mode 100644 pkg/integration/tests/filter_by_path/type_file.go delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/COMMIT_EDITMSG delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/FETCH_HEAD delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/HEAD delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/config delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/description delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/index delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/info/exclude delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/logs/HEAD delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/logs/refs/heads/master delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/22/adc4567aba3d1a0acf28b4cef312922d516aeb delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/2e/a97a56215f6adbe991eaf0dcf61c7086880ea5 delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/4b/9d1f9f9fc76b123a5c90cd8396390cac41a3e3 delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/77/9de836a10ac879fa919f48d5dc4f4ce11528e2 delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/84/b823dc5fc92fcf08eb8c8545716232ce49bd45 delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/8b/476a1094290d7251c56305e199eb2a203d8682 delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/9e/88a70dc8d82dd2afbfd50176ef78e18823bc2c delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/af/3ef564e968dbe92fb4e08a67dd5f835f43d4e8 delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/b7/c728d5b4e9dfc210ec19f0549f25c94b766e4e delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/d7/236d5f85ad303f5f23141661e4c8959610b70b delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/f2/4812da035a21812bc4c73018349ac2f0a6ec39 delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/objects/f3/d94fa1d4be39b8daae35b82525bf357aa712de delete mode 100644 test/integration/filterPath/expected/repo/.git_keep/refs/heads/master delete mode 100644 test/integration/filterPath/expected/repo/file delete mode 100644 test/integration/filterPath/expected/repo/file0 delete mode 100644 test/integration/filterPath/expected/repo/file2 delete mode 100644 test/integration/filterPath/recording.json delete mode 100644 test/integration/filterPath/setup.sh delete mode 100644 test/integration/filterPath/test.json delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/COMMIT_EDITMSG delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/FETCH_HEAD delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/HEAD delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/config delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/description delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/index delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/info/exclude delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/logs/HEAD delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/logs/refs/heads/master delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/6c/dce80c062ba2c8f8758879834a936b84ead78c delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/70/3f7069185227287623aaba7cdb0e56ae7a6c60 delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/77/9de836a10ac879fa919f48d5dc4f4ce11528e2 delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/84/b823dc5fc92fcf08eb8c8545716232ce49bd45 delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/92/ec47058a2894afbbbd69c5f79bff20c503e686 delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/9e/88a70dc8d82dd2afbfd50176ef78e18823bc2c delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/a5/c053a7a46bce2775edb371a9aa97424b542ab7 delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/c5/f9a8793f15aa0db816944424adb4303eb036a8 delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/c8/68546458601b9c71b76b893f9020ecf7405528 delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/objects/e7/c2bd00356720683d5bc4362ef5b92655fa8914 delete mode 100644 test/integration/filterPath2/expected/repo/.git_keep/refs/heads/master delete mode 100644 test/integration/filterPath2/expected/repo/file delete mode 100644 test/integration/filterPath2/expected/repo/file0 delete mode 100644 test/integration/filterPath2/expected/repo/file1 delete mode 100644 test/integration/filterPath2/expected/repo/file2 delete mode 100644 test/integration/filterPath2/recording.json delete mode 100644 test/integration/filterPath2/setup.sh delete mode 100644 test/integration/filterPath2/test.json delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/COMMIT_EDITMSG delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/FETCH_HEAD delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/HEAD delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/config delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/description delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/index delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/info/exclude delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/logs/HEAD delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/logs/refs/heads/master delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/23/1410172e8f51138f06d8dff963898fb1e97b30 delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/72/226d27a85fff688d32c134a22ebe650d6c2e41 delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/77/9de836a10ac879fa919f48d5dc4f4ce11528e2 delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/84/b823dc5fc92fcf08eb8c8545716232ce49bd45 delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/8e/d4f7b4eae8cc97d9add459348cc95e936b8f25 delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/9e/88a70dc8d82dd2afbfd50176ef78e18823bc2c delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/b3/5d7fa77c939890020952987eeb461f410297d8 delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/c1/a1ba9d2873d7163606bb5fdf46e50975db042b delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/c8/68546458601b9c71b76b893f9020ecf7405528 delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/db/6681a3e9fb9fb6ef524771cdc763904dd2b54d delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b delete mode 100644 test/integration/filterPath3/expected/repo/.git_keep/refs/heads/master delete mode 100644 test/integration/filterPath3/expected/repo/file delete mode 100644 test/integration/filterPath3/expected/repo/file0 delete mode 100644 test/integration/filterPath3/expected/repo/file1 delete mode 100644 test/integration/filterPath3/expected/repo/file2 delete mode 100644 test/integration/filterPath3/recording.json delete mode 100644 test/integration/filterPath3/setup.sh delete mode 100644 test/integration/filterPath3/test.json diff --git a/pkg/integration/tests/filter_by_path/cli.go b/pkg/integration/tests/filter_by_path/cli.go new file mode 100644 index 000000000..12e9e91fa --- /dev/null +++ b/pkg/integration/tests/filter_by_path/cli.go @@ -0,0 +1,20 @@ +package filter_by_path + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var CliArg = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Filter commits by file path, using CLI arg", + ExtraCmdArgs: "-f filterFile", + Skip: false, + SetupConfig: func(config *config.AppConfig) { + }, + SetupRepo: func(shell *Shell) { + commonSetup(shell) + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + postFilterTest(t, keys) + }, +}) diff --git a/pkg/integration/tests/filter_by_path/select_file.go b/pkg/integration/tests/filter_by_path/select_file.go new file mode 100644 index 000000000..a4183de87 --- /dev/null +++ b/pkg/integration/tests/filter_by_path/select_file.go @@ -0,0 +1,76 @@ +package filter_by_path + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var SelectFile = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Filter commits by file path, by finding file in UI and filtering on it", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(config *config.AppConfig) { + }, + SetupRepo: func(shell *Shell) { + commonSetup(shell) + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Commits(). + Focus(). + Lines( + Contains(`only filterFile`).IsSelected(), + Contains(`only otherFile`), + Contains(`both files`), + ). + PressEnter() + + // when you click into the commit itself, you see all files from that commit + t.Views().CommitFiles(). + IsFocused(). + Lines( + Contains(`filterFile`).IsSelected(), + ). + Press(keys.Universal.FilteringMenu) + + t.ExpectPopup().Menu().Title(Equals("Filtering")).Select(Contains("filter by 'filterFile'")).Confirm() + + postFilterTest(t, keys) + }, +}) + +func commonSetup(shell *Shell) { + shell.CreateFileAndAdd("filterFile", "original filterFile content") + shell.CreateFileAndAdd("otherFile", "original otherFile content") + shell.Commit("both files") + + shell.UpdateFileAndAdd("otherFile", "new otherFile content") + shell.Commit("only otherFile") + + shell.UpdateFileAndAdd("filterFile", "new filterFile content") + shell.Commit("only filterFile") +} + +func postFilterTest(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Information().Content(Contains("filtering by 'filterFile'")) + + t.Views().Commits(). + IsFocused(). + Lines( + Contains(`only filterFile`).IsSelected(), + Contains(`both files`), + ). + SelectNextItem(). + PressEnter() + + // we only show the filtered file's changes in the main view + t.Views().Main(). + Content(Contains("filterFile").DoesNotContain("otherFile")) + + // when you click into the commit itself, you see all files from that commit + t.Views().CommitFiles(). + IsFocused(). + Lines( + Contains(`filterFile`), + Contains(`otherFile`), + ) +} diff --git a/pkg/integration/tests/filter_by_path/type_file.go b/pkg/integration/tests/filter_by_path/type_file.go new file mode 100644 index 000000000..9461635c6 --- /dev/null +++ b/pkg/integration/tests/filter_by_path/type_file.go @@ -0,0 +1,35 @@ +package filter_by_path + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var TypeFile = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Filter commits by file path, by finding file in UI and filtering on it", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(config *config.AppConfig) { + }, + SetupRepo: func(shell *Shell) { + commonSetup(shell) + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Files(). + IsFocused(). + Press(keys.Universal.FilteringMenu) + + t.ExpectPopup().Menu(). + Title(Equals("Filtering")). + Select(Contains("enter path to filter by")). + Confirm() + + t.ExpectPopup().Prompt(). + Title(Equals("Enter path:")). + Type("filterF"). + SuggestionLines(Equals("filterFile")). + ConfirmFirstSuggestion() + + postFilterTest(t, keys) + }, +}) diff --git a/pkg/integration/tests/tests.go b/pkg/integration/tests/tests.go index bba5f38e3..f7463d0da 100644 --- a/pkg/integration/tests/tests.go +++ b/pkg/integration/tests/tests.go @@ -18,6 +18,7 @@ import ( "github.com/jesseduffield/lazygit/pkg/integration/tests/custom_commands" "github.com/jesseduffield/lazygit/pkg/integration/tests/diff" "github.com/jesseduffield/lazygit/pkg/integration/tests/file" + "github.com/jesseduffield/lazygit/pkg/integration/tests/filter_by_path" "github.com/jesseduffield/lazygit/pkg/integration/tests/interactive_rebase" "github.com/jesseduffield/lazygit/pkg/integration/tests/misc" "github.com/jesseduffield/lazygit/pkg/integration/tests/stash" @@ -67,6 +68,9 @@ var tests = []*components.IntegrationTest{ diff.DiffCommits, sync.FetchPrune, sync.RenameBranchAndPull, + filter_by_path.CliArg, + filter_by_path.SelectFile, + filter_by_path.TypeFile, } func GetTests() []*components.IntegrationTest { diff --git a/test/integration/filterPath/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/filterPath/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 9daeafb98..000000000 --- a/test/integration/filterPath/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/test/integration/filterPath/expected/repo/.git_keep/FETCH_HEAD b/test/integration/filterPath/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/filterPath/expected/repo/.git_keep/HEAD b/test/integration/filterPath/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/filterPath/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/filterPath/expected/repo/.git_keep/config b/test/integration/filterPath/expected/repo/.git_keep/config deleted file mode 100644 index 8ae104545..000000000 --- a/test/integration/filterPath/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/filterPath/expected/repo/.git_keep/description b/test/integration/filterPath/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/filterPath/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/filterPath/expected/repo/.git_keep/index b/test/integration/filterPath/expected/repo/.git_keep/index deleted file mode 100644 index 168285e76b0e028c3212ef80df2f4fd56e646d34..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 281 zcmZ?q402{*U|<4b=7j7m#|0&pYQbnm1_l;3U2aPThQ=if42)laYD9pT?UKpS2jTyW zj+MPie{tI4OH%Bu*C7lnX_+~xKv^IF>E}s3Xbhtv=5W11H^)N6>dJzDTHD?QA9~-p z^yZ_zQ%!F%u!77nfSGfeL;7bk&>S!gbx$z5ITAcSj2e{ooqM@zQFv8<%PZ~q7U~dl zjKJoE1i88b8Ilaf3I<%;k851r^78&6fj5#LLguTU^e)Tu3tw)zY_^%~+ 1617671367 +1000 commit (initial): file0 -f3d94fa1d4be39b8daae35b82525bf357aa712de 4b9d1f9f9fc76b123a5c90cd8396390cac41a3e3 CI 1617671367 +1000 commit: file1 -4b9d1f9f9fc76b123a5c90cd8396390cac41a3e3 d7236d5f85ad303f5f23141661e4c8959610b70b CI 1617671367 +1000 commit: file2 -d7236d5f85ad303f5f23141661e4c8959610b70b f24812da035a21812bc4c73018349ac2f0a6ec39 CI 1617671367 +1000 commit: file1 and file2 -f24812da035a21812bc4c73018349ac2f0a6ec39 8b476a1094290d7251c56305e199eb2a203d8682 CI 1617671367 +1000 commit: file -8b476a1094290d7251c56305e199eb2a203d8682 af3ef564e968dbe92fb4e08a67dd5f835f43d4e8 CI 1617671375 +1000 commit: asd -af3ef564e968dbe92fb4e08a67dd5f835f43d4e8 22adc4567aba3d1a0acf28b4cef312922d516aeb CI 1617671383 +1000 commit: test diff --git a/test/integration/filterPath/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/filterPath/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index 808615246..000000000 --- a/test/integration/filterPath/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1,7 +0,0 @@ -0000000000000000000000000000000000000000 f3d94fa1d4be39b8daae35b82525bf357aa712de CI 1617671367 +1000 commit (initial): file0 -f3d94fa1d4be39b8daae35b82525bf357aa712de 4b9d1f9f9fc76b123a5c90cd8396390cac41a3e3 CI 1617671367 +1000 commit: file1 -4b9d1f9f9fc76b123a5c90cd8396390cac41a3e3 d7236d5f85ad303f5f23141661e4c8959610b70b CI 1617671367 +1000 commit: file2 -d7236d5f85ad303f5f23141661e4c8959610b70b f24812da035a21812bc4c73018349ac2f0a6ec39 CI 1617671367 +1000 commit: file1 and file2 -f24812da035a21812bc4c73018349ac2f0a6ec39 8b476a1094290d7251c56305e199eb2a203d8682 CI 1617671367 +1000 commit: file -8b476a1094290d7251c56305e199eb2a203d8682 af3ef564e968dbe92fb4e08a67dd5f835f43d4e8 CI 1617671375 +1000 commit: asd -af3ef564e968dbe92fb4e08a67dd5f835f43d4e8 22adc4567aba3d1a0acf28b4cef312922d516aeb CI 1617671383 +1000 commit: test diff --git a/test/integration/filterPath/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 b/test/integration/filterPath/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 deleted file mode 100644 index f74bf2335bbc5999ad0faff94fb04165d8ab5c7d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb~ZE#08nZNMgRZ+ diff --git a/test/integration/filterPath/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 b/test/integration/filterPath/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 deleted file mode 100644 index 79fcadf67fdecb0f0cffca7ff27b2ae5c031e4d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 50 zcmV-20L}k+0V^p=O;s>9W-v4`Ff%bxNXyJgHDIt1vAVM0pVqc_!H3>=F1`6^?^M%U I033l4YT~68jQ{`u diff --git a/test/integration/filterPath/expected/repo/.git_keep/objects/22/adc4567aba3d1a0acf28b4cef312922d516aeb b/test/integration/filterPath/expected/repo/.git_keep/objects/22/adc4567aba3d1a0acf28b4cef312922d516aeb deleted file mode 100644 index 7d99988a796fbac8d9d71409c9a953a64aa32559..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 146 zcmV;D0B!$x0gaAH3IZ_@06pgwxeJoc(n&x>@HEfJ(v5;~hOq^oZ=T?_sDf(i7!T2q z;UGJauCYa%dZ?aq=VrlBgUlxQ%r>;_YeXbZYAZXvL>G3%0jG_rSIU-WX;Q)1d*I{( zd)GZBRX%cGcYRy*`L~E1|cjAFEb6JnorA AumAu6 diff --git a/test/integration/filterPath/expected/repo/.git_keep/objects/2e/a97a56215f6adbe991eaf0dcf61c7086880ea5 b/test/integration/filterPath/expected/repo/.git_keep/objects/2e/a97a56215f6adbe991eaf0dcf61c7086880ea5 deleted file mode 100644 index 0790c9b90ae81e18bee240b573ffc24de9717378..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 126 zcmV-^0D=E_0V^p=O;s>7He@g~FfcPQQAo?oNoBZXa`Zv?Kci!1uhL(fw)m11d+T)w zlDq+fg^1Oa1^=|Ry$e3{zH{l#M|-E5-a=Af$gp(JAs4j gz=%PD=Z8^)(!O&qS1k&!>Th|aJ>Nnd01ApbkfO;wrvLx| diff --git a/test/integration/filterPath/expected/repo/.git_keep/objects/38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da b/test/integration/filterPath/expected/repo/.git_keep/objects/38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da deleted file mode 100644 index 06c9cb73d7a8ed6841ce407bd6bb15235c8fa15c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb|y2)08mZ`J^%m! diff --git a/test/integration/filterPath/expected/repo/.git_keep/objects/4b/9d1f9f9fc76b123a5c90cd8396390cac41a3e3 b/test/integration/filterPath/expected/repo/.git_keep/objects/4b/9d1f9f9fc76b123a5c90cd8396390cac41a3e3 deleted file mode 100644 index 1ea243810ba144fd7fc5cfebe114c24aa24f4d70..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 148 zcmV;F0Biqv0gcX03c@fDKw;N8MfQSZGWlshMChu=m`o;EXiO;)Jia}G+sC(f+*@0R zhGZ|}5YffNz?_&(A||p0L(Lp1`C3pcn&6TP4%AMEyoat>lB)#8Wx=F1`6^?^M%U zND2%Y?q~CApDBCxhX0hpA$0*Se~n#7q>&UDF7He@g~FfcPQQAo?oNoBZXa`Zv?Kci!1uhL(fw)m11d+T)w zlDq+fg^1Oa1^=|Ry$e3{zH{l#M|-E5-a=Af$Z$WKSNlxavp4*w6b`8ic=>DWIwFmv MzzC}q0NVUKm*jmiwEzGB diff --git a/test/integration/filterPath/expected/repo/.git_keep/objects/8b/476a1094290d7251c56305e199eb2a203d8682 b/test/integration/filterPath/expected/repo/.git_keep/objects/8b/476a1094290d7251c56305e199eb2a203d8682 deleted file mode 100644 index 8e06bcc670c4366e1a3908903e6dd097c2328202..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 146 zcmV;D0B!$x0gaAJ3c@fDKwak)vlk>Y`GbhiRgaNOCs=4qDG@xrJ%YQ(<1HTd*46=- z@G=e&h_*yB3%kmRDpwt)M2^n7fSwGo*i;tl)SeG{52$1#(vr1tnefEImV?n4jZK-U z>g=F1`6^?^M%U zND2%YmhO4{S2gv2WLwJR>kD diff --git a/test/integration/filterPath/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/filterPath/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/filterPath/expected/repo/.git_keep/objects/af/3ef564e968dbe92fb4e08a67dd5f835f43d4e8 b/test/integration/filterPath/expected/repo/.git_keep/objects/af/3ef564e968dbe92fb4e08a67dd5f835f43d4e8 deleted file mode 100644 index 316e3d05c051845d8eef1dcc562ced0c830fa039..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 145 zcmV;C0B-+y0gaA93c@fD06pgwxeKzJHoI9UBJ|W}Y?Cbt#+Dkv=i4WE9cEziTI-{E z6gair%m-6pjTA60q-8b{G+m(Ng)lQDN(oG(+jO^A^J(sx6hZnRP&h=)kvfQmA~pvN z(3PVJPCxCw?tYy7Fito7YTcf8$!ooOBxGXjIQlaJfIH|h)$C8*>ASces-rjx^%g>5 diff --git a/test/integration/filterPath/expected/repo/.git_keep/objects/b7/c728d5b4e9dfc210ec19f0549f25c94b766e4e b/test/integration/filterPath/expected/repo/.git_keep/objects/b7/c728d5b4e9dfc210ec19f0549f25c94b766e4e deleted file mode 100644 index 99737800047abf796860c58e42be982fb2ae3bd7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 100 zcmV-q0Gt1K0V^p=O;xb8U@$Z=Ff%bxNXyJgWw>N=^g;MPqhn>S(qEjm_>vTR>vaf{ zya9uSh}D$^|FpKf3qJI|bLq`Td#9S-LQ-JFAi?v)s6lDpxtFUJg;({rywaX;p$-5h GxGkehVlpNG diff --git a/test/integration/filterPath/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 b/test/integration/filterPath/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 deleted file mode 100644 index 2e9066287..000000000 --- a/test/integration/filterPath/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 +++ /dev/null @@ -1,2 +0,0 @@ -x+)JMU03c040031QHI5`ֶww.hT[H - yW5Ɨ(| ^-W(x9 \ No newline at end of file diff --git a/test/integration/filterPath/expected/repo/.git_keep/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 b/test/integration/filterPath/expected/repo/.git_keep/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 deleted file mode 100644 index d39fa7d2fecf1c45a132dfe3a8758952f3c8d968..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb}lpN08nuUO8@`> diff --git a/test/integration/filterPath/expected/repo/.git_keep/objects/d7/236d5f85ad303f5f23141661e4c8959610b70b b/test/integration/filterPath/expected/repo/.git_keep/objects/d7/236d5f85ad303f5f23141661e4c8959610b70b deleted file mode 100644 index a1504b27d..000000000 --- a/test/integration/filterPath/expected/repo/.git_keep/objects/d7/236d5f85ad303f5f23141661e4c8959610b70b +++ /dev/null @@ -1,2 +0,0 @@ -xA - E DG(U1# y|nn]C~(LfhsTRɳ@.eu)ﮧ38'f3(_˪/c>A_9WeŪ:6 \ No newline at end of file diff --git a/test/integration/filterPath/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b b/test/integration/filterPath/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b deleted file mode 100644 index 9b771fc2f6f41f91b00976b4ff3f8f9935f7931e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb>`CU&08otwO#lD@ diff --git a/test/integration/filterPath/expected/repo/.git_keep/objects/f2/4812da035a21812bc4c73018349ac2f0a6ec39 b/test/integration/filterPath/expected/repo/.git_keep/objects/f2/4812da035a21812bc4c73018349ac2f0a6ec39 deleted file mode 100644 index de38ddd8b..000000000 --- a/test/integration/filterPath/expected/repo/.git_keep/objects/f2/4812da035a21812bc4c73018349ac2f0a6ec39 +++ /dev/null @@ -1,2 +0,0 @@ -xK -0@]$$ "tcL zw[6w0\!DHQs*'LKveA&Q;v(dl(Fj[}5rL>I񻿶}[0 BV=:/k_b; \ No newline at end of file diff --git a/test/integration/filterPath/expected/repo/.git_keep/objects/f3/d94fa1d4be39b8daae35b82525bf357aa712de b/test/integration/filterPath/expected/repo/.git_keep/objects/f3/d94fa1d4be39b8daae35b82525bf357aa712de deleted file mode 100644 index cb9dd46d07eaf88727420e6525632b9cf2c85606..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 118 zcmV-+0Ez#20gcT;3c@fDMq$@E#q0%{Nyo&1h|pD!ku-m>&=4sRdi?eXZXX}Kxz)OK z64guJ01^yvK7|l+lDl^?3&4+5w6ION*Z>Wx*2G``w2j7zp5ye!9_x3-ZEp2N;>0^I YgY$G1W;SO%CmnxsQ^zf}XdjJ3c diff --git a/test/integration/filterPath/expected/repo/.git_keep/refs/heads/master b/test/integration/filterPath/expected/repo/.git_keep/refs/heads/master deleted file mode 100644 index 6e1574559..000000000 --- a/test/integration/filterPath/expected/repo/.git_keep/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -22adc4567aba3d1a0acf28b4cef312922d516aeb diff --git a/test/integration/filterPath/expected/repo/file b/test/integration/filterPath/expected/repo/file deleted file mode 100644 index d234c5e05..000000000 --- a/test/integration/filterPath/expected/repo/file +++ /dev/null @@ -1 +0,0 @@ -test4 diff --git a/test/integration/filterPath/expected/repo/file0 b/test/integration/filterPath/expected/repo/file0 deleted file mode 100644 index 38143ad4a..000000000 --- a/test/integration/filterPath/expected/repo/file0 +++ /dev/null @@ -1 +0,0 @@ -test0 diff --git a/test/integration/filterPath/expected/repo/file2 b/test/integration/filterPath/expected/repo/file2 deleted file mode 100644 index 180cf8328..000000000 --- a/test/integration/filterPath/expected/repo/file2 +++ /dev/null @@ -1 +0,0 @@ -test2 diff --git a/test/integration/filterPath/recording.json b/test/integration/filterPath/recording.json deleted file mode 100644 index 58818be45..000000000 --- a/test/integration/filterPath/recording.json +++ /dev/null @@ -1 +0,0 @@ -{"KeyEvents":[{"Timestamp":1102,"Mod":0,"Key":13,"Ch":13},{"Timestamp":1422,"Mod":0,"Key":256,"Ch":32},{"Timestamp":1591,"Mod":0,"Key":258,"Ch":0},{"Timestamp":1718,"Mod":0,"Key":256,"Ch":32},{"Timestamp":2391,"Mod":2,"Key":16,"Ch":16},{"Timestamp":3318,"Mod":0,"Key":258,"Ch":0},{"Timestamp":3454,"Mod":0,"Key":258,"Ch":0},{"Timestamp":3686,"Mod":0,"Key":13,"Ch":13},{"Timestamp":4339,"Mod":0,"Key":27,"Ch":0},{"Timestamp":4725,"Mod":0,"Key":27,"Ch":0},{"Timestamp":5591,"Mod":0,"Key":260,"Ch":0},{"Timestamp":5903,"Mod":0,"Key":260,"Ch":0},{"Timestamp":6494,"Mod":0,"Key":256,"Ch":99},{"Timestamp":7046,"Mod":0,"Key":256,"Ch":97},{"Timestamp":7102,"Mod":0,"Key":256,"Ch":115},{"Timestamp":7157,"Mod":0,"Key":256,"Ch":100},{"Timestamp":7677,"Mod":0,"Key":13,"Ch":13},{"Timestamp":8261,"Mod":0,"Key":259,"Ch":0},{"Timestamp":8558,"Mod":0,"Key":259,"Ch":0},{"Timestamp":8990,"Mod":0,"Key":258,"Ch":0},{"Timestamp":9270,"Mod":0,"Key":258,"Ch":0},{"Timestamp":9910,"Mod":0,"Key":13,"Ch":13},{"Timestamp":10614,"Mod":0,"Key":256,"Ch":32},{"Timestamp":11278,"Mod":2,"Key":16,"Ch":16},{"Timestamp":11894,"Mod":0,"Key":258,"Ch":0},{"Timestamp":12046,"Mod":0,"Key":258,"Ch":0},{"Timestamp":12335,"Mod":0,"Key":13,"Ch":13},{"Timestamp":12761,"Mod":0,"Key":27,"Ch":0},{"Timestamp":13080,"Mod":0,"Key":27,"Ch":0},{"Timestamp":13822,"Mod":0,"Key":260,"Ch":0},{"Timestamp":14022,"Mod":0,"Key":260,"Ch":0},{"Timestamp":14630,"Mod":0,"Key":256,"Ch":99},{"Timestamp":14894,"Mod":0,"Key":256,"Ch":116},{"Timestamp":14958,"Mod":0,"Key":256,"Ch":101},{"Timestamp":15150,"Mod":0,"Key":256,"Ch":115},{"Timestamp":15207,"Mod":0,"Key":256,"Ch":116},{"Timestamp":15558,"Mod":0,"Key":13,"Ch":13},{"Timestamp":16294,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]} \ No newline at end of file diff --git a/test/integration/filterPath/setup.sh b/test/integration/filterPath/setup.sh deleted file mode 100644 index 460b35b25..000000000 --- a/test/integration/filterPath/setup.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -set -e - -cd $1 - -git init - -git config user.email "CI@example.com" -git config user.name "CI" - -# need a history of commits each containing various files - -echo test0 > file0 -git add . -git commit -am file0 - -echo test1 > file1 -git add . -git commit -am file1 - -echo test2 > file2 -git add . -git commit -am "file2" - -echo test3 > file1 -echo test4 > file2 -git add . -git commit -am "file1 and file2" - -echo test4 > file -git add . -git commit -am "file" diff --git a/test/integration/filterPath/test.json b/test/integration/filterPath/test.json deleted file mode 100644 index 122b296b3..000000000 --- a/test/integration/filterPath/test.json +++ /dev/null @@ -1 +0,0 @@ -{ "description": "Open lazygit with a filter path given", "speed": 10, "extraCmdArgs": "-f file1" } diff --git a/test/integration/filterPath2/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/filterPath2/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 9daeafb98..000000000 --- a/test/integration/filterPath2/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/test/integration/filterPath2/expected/repo/.git_keep/FETCH_HEAD b/test/integration/filterPath2/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/filterPath2/expected/repo/.git_keep/HEAD b/test/integration/filterPath2/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/filterPath2/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/filterPath2/expected/repo/.git_keep/config b/test/integration/filterPath2/expected/repo/.git_keep/config deleted file mode 100644 index 8ae104545..000000000 --- a/test/integration/filterPath2/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/filterPath2/expected/repo/.git_keep/description b/test/integration/filterPath2/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/filterPath2/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/filterPath2/expected/repo/.git_keep/index b/test/integration/filterPath2/expected/repo/.git_keep/index deleted file mode 100644 index 1f806870633df427b39fbbe0b64d73241aec450f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 353 zcmZ?q402{*U|<4bmW1prH&l$GYGE`ZP>fBN$B==caR~zh<5!>>5g=x}WODRD_&=j# zWv|j-oVNIq6npD+2m?!6W=<+l76?H4 1617671384 +1000 commit (initial): file0 -703f7069185227287623aaba7cdb0e56ae7a6c60 a5c053a7a46bce2775edb371a9aa97424b542ab7 CI 1617671384 +1000 commit: file1 -a5c053a7a46bce2775edb371a9aa97424b542ab7 6cdce80c062ba2c8f8758879834a936b84ead78c CI 1617671384 +1000 commit: file2 -6cdce80c062ba2c8f8758879834a936b84ead78c c5f9a8793f15aa0db816944424adb4303eb036a8 CI 1617671384 +1000 commit: file1 and file2 -c5f9a8793f15aa0db816944424adb4303eb036a8 e7c2bd00356720683d5bc4362ef5b92655fa8914 CI 1617671384 +1000 commit: file -e7c2bd00356720683d5bc4362ef5b92655fa8914 92ec47058a2894afbbbd69c5f79bff20c503e686 CI 1617671407 +1000 commit: test diff --git a/test/integration/filterPath2/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/filterPath2/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index 3875aa5f3..000000000 --- a/test/integration/filterPath2/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1,6 +0,0 @@ -0000000000000000000000000000000000000000 703f7069185227287623aaba7cdb0e56ae7a6c60 CI 1617671384 +1000 commit (initial): file0 -703f7069185227287623aaba7cdb0e56ae7a6c60 a5c053a7a46bce2775edb371a9aa97424b542ab7 CI 1617671384 +1000 commit: file1 -a5c053a7a46bce2775edb371a9aa97424b542ab7 6cdce80c062ba2c8f8758879834a936b84ead78c CI 1617671384 +1000 commit: file2 -6cdce80c062ba2c8f8758879834a936b84ead78c c5f9a8793f15aa0db816944424adb4303eb036a8 CI 1617671384 +1000 commit: file1 and file2 -c5f9a8793f15aa0db816944424adb4303eb036a8 e7c2bd00356720683d5bc4362ef5b92655fa8914 CI 1617671384 +1000 commit: file -e7c2bd00356720683d5bc4362ef5b92655fa8914 92ec47058a2894afbbbd69c5f79bff20c503e686 CI 1617671407 +1000 commit: test diff --git a/test/integration/filterPath2/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 b/test/integration/filterPath2/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 deleted file mode 100644 index f74bf2335bbc5999ad0faff94fb04165d8ab5c7d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb~ZE#08nZNMgRZ+ diff --git a/test/integration/filterPath2/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 b/test/integration/filterPath2/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 deleted file mode 100644 index 79fcadf67fdecb0f0cffca7ff27b2ae5c031e4d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 50 zcmV-20L}k+0V^p=O;s>9W-v4`Ff%bxNXyJgHDIt1vAVM0pVqc_!H3>=F1`6^?^M%U I033l4YT~68jQ{`u diff --git a/test/integration/filterPath2/expected/repo/.git_keep/objects/38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da b/test/integration/filterPath2/expected/repo/.git_keep/objects/38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da deleted file mode 100644 index 06c9cb73d7a8ed6841ce407bd6bb15235c8fa15c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb|y2)08mZ`J^%m! diff --git a/test/integration/filterPath2/expected/repo/.git_keep/objects/6c/dce80c062ba2c8f8758879834a936b84ead78c b/test/integration/filterPath2/expected/repo/.git_keep/objects/6c/dce80c062ba2c8f8758879834a936b84ead78c deleted file mode 100644 index 6381fde43069dd6b10fb51c7945b7fd7f9439f39..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 147 zcmV;E0Brww0gaA93d0}}0DJZo-U~%n&8|>NA*VcJ)s+Tf4Z%X6-#nq$VHhU&*4CkI zgv&TYbQB^+Q!*8TQh;l!B^Zm7R3x!P;8KRHc0S}iG>2@0V`M+2EPxoKB!`wGb3_k5 z1rMB1@n^jHq31>4=jAD1Zu=&;+}lIj>CB^brapIkq YVN|*bGn=!Xla4>RDeDF{Kiokp@>oANV*mgE diff --git a/test/integration/filterPath2/expected/repo/.git_keep/objects/77/9de836a10ac879fa919f48d5dc4f4ce11528e2 b/test/integration/filterPath2/expected/repo/.git_keep/objects/77/9de836a10ac879fa919f48d5dc4f4ce11528e2 deleted file mode 100644 index ad968bd2faee3437d9a46d3b444edfe484933b81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 101 zcmV-r0Gj`J0V^p=O;xb8WH2-^Ff%bxNXyJgHDIt1vAVM0pVqc_!H3>=F1`6^?^M%U zND2%Y?q~CApDBCxhX0hpA$0*Se~n#7q>&UDF7He@g~FfcPQQAo?oNoBZXa`Zv?Kci!1uhL(fw)m11d+T)w zlDq+fg^1Oa1^=|Ry$e3{zH{l#M|-E5-a=Af$Z$WKSNlxavp4*w6b`8ic=>DWIwFmv MzzC}q0NVUKm*jmiwEzGB diff --git a/test/integration/filterPath2/expected/repo/.git_keep/objects/92/ec47058a2894afbbbd69c5f79bff20c503e686 b/test/integration/filterPath2/expected/repo/.git_keep/objects/92/ec47058a2894afbbbd69c5f79bff20c503e686 deleted file mode 100644 index 59f937373459e5fc468132838a78db7d881b69eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 147 zcmV;E0Brww0gcW<3c@fDKvCB@MfQTsB$=56M1-z-j3iD_Ft*eP9^W3p?dL6iU3z~E ziwO^7Q?)g6q`-k91C~?;i*Sj_w*(HfHVHuFqFM8%uVGcHD>nd7EDkvO8=F1`6^?^M%U zND2%YmhO4{S2gv2WLwJR>kD diff --git a/test/integration/filterPath2/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/filterPath2/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/filterPath2/expected/repo/.git_keep/objects/a5/c053a7a46bce2775edb371a9aa97424b542ab7 b/test/integration/filterPath2/expected/repo/.git_keep/objects/a5/c053a7a46bce2775edb371a9aa97424b542ab7 deleted file mode 100644 index af9315feec24994f8b70b281e1aec77b6b58b5b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 148 zcmV;F0Biqv0gcWv3d1lAK+(=Vh4(^{Y)6WrltQK)Ly=_~NSY8_=<%B)bp5>H>$a|Q z^O(b>9cI1&lWJClEGiO8q&g`}?rMn^B2dbS61rUudpFMzD+6WhyAU|^Od*O)!dfP< zj>K3<37mY|Ydicf`ui|G?JMiP*iE7He@g~FfcPQQAo?oNoBZXa`Zv?Kci!1uhL(fw)m11d+T)w zlDq+fg^1Oa1^=|Ry$e3{zH{l#M|-E5-a=Af$gp(JAs4j MzzC}q04bP0UJbu9e*gdg diff --git a/test/integration/filterPath2/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 b/test/integration/filterPath2/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 deleted file mode 100644 index 2e9066287..000000000 --- a/test/integration/filterPath2/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 +++ /dev/null @@ -1,2 +0,0 @@ -x+)JMU03c040031QHI5`ֶww.hT[H - yW5Ɨ(| ^-W(x9 \ No newline at end of file diff --git a/test/integration/filterPath2/expected/repo/.git_keep/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 b/test/integration/filterPath2/expected/repo/.git_keep/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 deleted file mode 100644 index d39fa7d2fecf1c45a132dfe3a8758952f3c8d968..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb}lpN08nuUO8@`> diff --git a/test/integration/filterPath2/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b b/test/integration/filterPath2/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b deleted file mode 100644 index 9b771fc2f6f41f91b00976b4ff3f8f9935f7931e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb>`CU&08otwO#lD@ diff --git a/test/integration/filterPath2/expected/repo/.git_keep/objects/e7/c2bd00356720683d5bc4362ef5b92655fa8914 b/test/integration/filterPath2/expected/repo/.git_keep/objects/e7/c2bd00356720683d5bc4362ef5b92655fa8914 deleted file mode 100644 index bfd62d1d3..000000000 --- a/test/integration/filterPath2/expected/repo/.git_keep/objects/e7/c2bd00356720683d5bc4362ef5b92655fa8914 +++ /dev/null @@ -1,3 +0,0 @@ -xA - @Ѯ=BqtJ)dc:@lB7Gl/CC8D4a&j$J3$ -yu\ѫy}kM!!Eq L?z}徯r+[hCG`Qg=U[VQ?9 \ No newline at end of file diff --git a/test/integration/filterPath2/expected/repo/.git_keep/refs/heads/master b/test/integration/filterPath2/expected/repo/.git_keep/refs/heads/master deleted file mode 100644 index 72fc50fcc..000000000 --- a/test/integration/filterPath2/expected/repo/.git_keep/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -92ec47058a2894afbbbd69c5f79bff20c503e686 diff --git a/test/integration/filterPath2/expected/repo/file b/test/integration/filterPath2/expected/repo/file deleted file mode 100644 index d234c5e05..000000000 --- a/test/integration/filterPath2/expected/repo/file +++ /dev/null @@ -1 +0,0 @@ -test4 diff --git a/test/integration/filterPath2/expected/repo/file0 b/test/integration/filterPath2/expected/repo/file0 deleted file mode 100644 index 38143ad4a..000000000 --- a/test/integration/filterPath2/expected/repo/file0 +++ /dev/null @@ -1 +0,0 @@ -test0 diff --git a/test/integration/filterPath2/expected/repo/file1 b/test/integration/filterPath2/expected/repo/file1 deleted file mode 100644 index a5bce3fd2..000000000 --- a/test/integration/filterPath2/expected/repo/file1 +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/test/integration/filterPath2/expected/repo/file2 b/test/integration/filterPath2/expected/repo/file2 deleted file mode 100644 index d234c5e05..000000000 --- a/test/integration/filterPath2/expected/repo/file2 +++ /dev/null @@ -1 +0,0 @@ -test4 diff --git a/test/integration/filterPath2/recording.json b/test/integration/filterPath2/recording.json deleted file mode 100644 index b857e533e..000000000 --- a/test/integration/filterPath2/recording.json +++ /dev/null @@ -1 +0,0 @@ -{"KeyEvents":[{"Timestamp":650,"Mod":0,"Key":259,"Ch":0},{"Timestamp":970,"Mod":0,"Key":259,"Ch":0},{"Timestamp":1547,"Mod":0,"Key":258,"Ch":0},{"Timestamp":2370,"Mod":0,"Key":13,"Ch":13},{"Timestamp":3506,"Mod":0,"Key":256,"Ch":120},{"Timestamp":4658,"Mod":0,"Key":256,"Ch":47},{"Timestamp":4971,"Mod":0,"Key":256,"Ch":102},{"Timestamp":5066,"Mod":0,"Key":256,"Ch":105},{"Timestamp":5106,"Mod":0,"Key":256,"Ch":108},{"Timestamp":5178,"Mod":0,"Key":256,"Ch":116},{"Timestamp":5266,"Mod":0,"Key":256,"Ch":101},{"Timestamp":5338,"Mod":0,"Key":256,"Ch":114},{"Timestamp":5426,"Mod":0,"Key":256,"Ch":45},{"Timestamp":5674,"Mod":0,"Key":256,"Ch":98},{"Timestamp":5698,"Mod":0,"Key":256,"Ch":121},{"Timestamp":5938,"Mod":0,"Key":256,"Ch":45},{"Timestamp":6148,"Mod":0,"Key":256,"Ch":112},{"Timestamp":6291,"Mod":0,"Key":256,"Ch":97},{"Timestamp":6330,"Mod":0,"Key":256,"Ch":116},{"Timestamp":6394,"Mod":0,"Key":256,"Ch":104},{"Timestamp":6666,"Mod":0,"Key":13,"Ch":13},{"Timestamp":8498,"Mod":0,"Key":13,"Ch":13},{"Timestamp":10194,"Mod":0,"Key":13,"Ch":13},{"Timestamp":12275,"Mod":0,"Key":13,"Ch":13},{"Timestamp":13378,"Mod":0,"Key":256,"Ch":32},{"Timestamp":14442,"Mod":2,"Key":16,"Ch":16},{"Timestamp":15442,"Mod":0,"Key":258,"Ch":0},{"Timestamp":15706,"Mod":0,"Key":258,"Ch":0},{"Timestamp":16058,"Mod":0,"Key":13,"Ch":13},{"Timestamp":17286,"Mod":0,"Key":27,"Ch":0},{"Timestamp":17992,"Mod":0,"Key":27,"Ch":0},{"Timestamp":18625,"Mod":0,"Key":27,"Ch":0},{"Timestamp":19883,"Mod":0,"Key":260,"Ch":0},{"Timestamp":20210,"Mod":0,"Key":260,"Ch":0},{"Timestamp":20987,"Mod":0,"Key":256,"Ch":99},{"Timestamp":21386,"Mod":0,"Key":256,"Ch":116},{"Timestamp":21514,"Mod":0,"Key":256,"Ch":101},{"Timestamp":21722,"Mod":0,"Key":256,"Ch":115},{"Timestamp":21770,"Mod":0,"Key":256,"Ch":116},{"Timestamp":22338,"Mod":0,"Key":13,"Ch":13},{"Timestamp":23658,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]} \ No newline at end of file diff --git a/test/integration/filterPath2/setup.sh b/test/integration/filterPath2/setup.sh deleted file mode 100644 index 460b35b25..000000000 --- a/test/integration/filterPath2/setup.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -set -e - -cd $1 - -git init - -git config user.email "CI@example.com" -git config user.name "CI" - -# need a history of commits each containing various files - -echo test0 > file0 -git add . -git commit -am file0 - -echo test1 > file1 -git add . -git commit -am file1 - -echo test2 > file2 -git add . -git commit -am "file2" - -echo test3 > file1 -echo test4 > file2 -git add . -git commit -am "file1 and file2" - -echo test4 > file -git add . -git commit -am "file" diff --git a/test/integration/filterPath2/test.json b/test/integration/filterPath2/test.json deleted file mode 100644 index 682ac9c2f..000000000 --- a/test/integration/filterPath2/test.json +++ /dev/null @@ -1 +0,0 @@ -{ "description": "Open filter path mode from within lazygit", "speed": 10 } diff --git a/test/integration/filterPath3/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/filterPath3/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 9daeafb98..000000000 --- a/test/integration/filterPath3/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -test diff --git a/test/integration/filterPath3/expected/repo/.git_keep/FETCH_HEAD b/test/integration/filterPath3/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/filterPath3/expected/repo/.git_keep/HEAD b/test/integration/filterPath3/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/filterPath3/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/filterPath3/expected/repo/.git_keep/config b/test/integration/filterPath3/expected/repo/.git_keep/config deleted file mode 100644 index 8ae104545..000000000 --- a/test/integration/filterPath3/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/filterPath3/expected/repo/.git_keep/description b/test/integration/filterPath3/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/filterPath3/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/filterPath3/expected/repo/.git_keep/index b/test/integration/filterPath3/expected/repo/.git_keep/index deleted file mode 100644 index 01d83d7537bc74b1f71dc8496e3581575187bfa2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 353 zcmZ?q402{*U|<4bmW1prANk{aw!>&fpctDjuP_5c;}Ql2#;-s%B0$V`$>ivR@P9_f z%3h_vIBoGIDfZUu5C)dC%$!u9ED(V7b8VYq0;3`3@Ek)o$3n#F%7TAd+uj8qdf&P9 z=A*q+O>Z% 1617671409 +1000 commit (initial): file0 -8ed4f7b4eae8cc97d9add459348cc95e936b8f25 c1a1ba9d2873d7163606bb5fdf46e50975db042b CI 1617671409 +1000 commit: file1 -c1a1ba9d2873d7163606bb5fdf46e50975db042b 72226d27a85fff688d32c134a22ebe650d6c2e41 CI 1617671409 +1000 commit: file2 -72226d27a85fff688d32c134a22ebe650d6c2e41 b35d7fa77c939890020952987eeb461f410297d8 CI 1617671409 +1000 commit: file1 and file2 -b35d7fa77c939890020952987eeb461f410297d8 231410172e8f51138f06d8dff963898fb1e97b30 CI 1617671409 +1000 commit: file -231410172e8f51138f06d8dff963898fb1e97b30 db6681a3e9fb9fb6ef524771cdc763904dd2b54d CI 1617671428 +1000 commit: test diff --git a/test/integration/filterPath3/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/filterPath3/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index 96c158987..000000000 --- a/test/integration/filterPath3/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1,6 +0,0 @@ -0000000000000000000000000000000000000000 8ed4f7b4eae8cc97d9add459348cc95e936b8f25 CI 1617671409 +1000 commit (initial): file0 -8ed4f7b4eae8cc97d9add459348cc95e936b8f25 c1a1ba9d2873d7163606bb5fdf46e50975db042b CI 1617671409 +1000 commit: file1 -c1a1ba9d2873d7163606bb5fdf46e50975db042b 72226d27a85fff688d32c134a22ebe650d6c2e41 CI 1617671409 +1000 commit: file2 -72226d27a85fff688d32c134a22ebe650d6c2e41 b35d7fa77c939890020952987eeb461f410297d8 CI 1617671409 +1000 commit: file1 and file2 -b35d7fa77c939890020952987eeb461f410297d8 231410172e8f51138f06d8dff963898fb1e97b30 CI 1617671409 +1000 commit: file -231410172e8f51138f06d8dff963898fb1e97b30 db6681a3e9fb9fb6ef524771cdc763904dd2b54d CI 1617671428 +1000 commit: test diff --git a/test/integration/filterPath3/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 b/test/integration/filterPath3/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 deleted file mode 100644 index f74bf2335bbc5999ad0faff94fb04165d8ab5c7d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb~ZE#08nZNMgRZ+ diff --git a/test/integration/filterPath3/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 b/test/integration/filterPath3/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 deleted file mode 100644 index 79fcadf67fdecb0f0cffca7ff27b2ae5c031e4d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 50 zcmV-20L}k+0V^p=O;s>9W-v4`Ff%bxNXyJgHDIt1vAVM0pVqc_!H3>=F1`6^?^M%U I033l4YT~68jQ{`u diff --git a/test/integration/filterPath3/expected/repo/.git_keep/objects/23/1410172e8f51138f06d8dff963898fb1e97b30 b/test/integration/filterPath3/expected/repo/.git_keep/objects/23/1410172e8f51138f06d8dff963898fb1e97b30 deleted file mode 100644 index 13b3042dc5b2e4c926f4e7a921fcd71d1450710d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 147 zcmV;E0Brww0gcW}3c@fDfMM4;MfQTs>D3V>k z<`4|WN-BNEYdiEb>-#i6<(vAx%B^hup)p_#5go9;A^@nfo>N2q|y2)08mZ`J^%m! diff --git a/test/integration/filterPath3/expected/repo/.git_keep/objects/72/226d27a85fff688d32c134a22ebe650d6c2e41 b/test/integration/filterPath3/expected/repo/.git_keep/objects/72/226d27a85fff688d32c134a22ebe650d6c2e41 deleted file mode 100644 index d1ad09fbd474faad4e86e0230a526b96477f5e53..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 148 zcmV;F0Biqv0gaA93d0}}0DJZo-V0@S6Lp1B3OVH&>aH{pn-DDY`OOo09fo1b*4ol7 zM!NJv)kbAb0i>`niBPJ!iUSN@YhXoY8gijx_H^jG+ky#mib5O)3Frq8K4({@j$R$a z;3UIH*`!Z@ZHJv^d!Oc~epB05y_Ky!Ec!DaaD-^D2mt1!=Tz4}byJsB$@~DxjXCtd C%|qD$ diff --git a/test/integration/filterPath3/expected/repo/.git_keep/objects/77/9de836a10ac879fa919f48d5dc4f4ce11528e2 b/test/integration/filterPath3/expected/repo/.git_keep/objects/77/9de836a10ac879fa919f48d5dc4f4ce11528e2 deleted file mode 100644 index ad968bd2faee3437d9a46d3b444edfe484933b81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 101 zcmV-r0Gj`J0V^p=O;xb8WH2-^Ff%bxNXyJgHDIt1vAVM0pVqc_!H3>=F1`6^?^M%U zND2%Y?q~CApDBCxhX0hpA$0*Se~n#7q>&UDF7He@g~FfcPQQAo?oNoBZXa`Zv?Kci!1uhL(fw)m11d+T)w zlDq+fg^1Oa1^=|Ry$e3{zH{l#M|-E5-a=Af$Z$WKSNlxavp4*w6b`8ic=>DWIwFmv MzzC}q0NVUKm*jmiwEzGB diff --git a/test/integration/filterPath3/expected/repo/.git_keep/objects/8e/d4f7b4eae8cc97d9add459348cc95e936b8f25 b/test/integration/filterPath3/expected/repo/.git_keep/objects/8e/d4f7b4eae8cc97d9add459348cc95e936b8f25 deleted file mode 100644 index defb8aeab..000000000 --- a/test/integration/filterPath3/expected/repo/.git_keep/objects/8e/d4f7b4eae8cc97d9add459348cc95e936b8f25 +++ /dev/null @@ -1,2 +0,0 @@ -xA -0Fa9c U4R"x|{޴6wS\b6C*=Wsޠ]0c_-Lk{!Yt]ۛ+ \ No newline at end of file diff --git a/test/integration/filterPath3/expected/repo/.git_keep/objects/9e/88a70dc8d82dd2afbfd50176ef78e18823bc2c b/test/integration/filterPath3/expected/repo/.git_keep/objects/9e/88a70dc8d82dd2afbfd50176ef78e18823bc2c deleted file mode 100644 index 0e95eb06dda15fe1901a7942e7954b700b36bfa9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 101 zcmV-r0Gj`J0V^p=O;xb8WH2-^Ff%bxNXyJgHDIt1vAVM0pVqc_!H3>=F1`6^?^M%U zND2%YmhO4{S2gv2WLwJR>kD diff --git a/test/integration/filterPath3/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 b/test/integration/filterPath3/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/filterPath3/expected/repo/.git_keep/objects/b3/5d7fa77c939890020952987eeb461f410297d8 b/test/integration/filterPath3/expected/repo/.git_keep/objects/b3/5d7fa77c939890020952987eeb461f410297d8 deleted file mode 100644 index 69c3bb790..000000000 --- a/test/integration/filterPath3/expected/repo/.git_keep/objects/b3/5d7fa77c939890020952987eeb461f410297d8 +++ /dev/null @@ -1,3 +0,0 @@ -xK -0@]$3D<Ƙ`iK7px+kkSt*ĘE-s匹$^(d6u(ENR -[ ԡw;~m^ncl3ZkaN""#2_<{ \ No newline at end of file diff --git a/test/integration/filterPath3/expected/repo/.git_keep/objects/c1/a1ba9d2873d7163606bb5fdf46e50975db042b b/test/integration/filterPath3/expected/repo/.git_keep/objects/c1/a1ba9d2873d7163606bb5fdf46e50975db042b deleted file mode 100644 index 7938b29c6..000000000 --- a/test/integration/filterPath3/expected/repo/.git_keep/objects/c1/a1ba9d2873d7163606bb5fdf46e50975db042b +++ /dev/null @@ -1,3 +0,0 @@ -xM -0F]$?"BW=t2D'kkKGwU(6'KHuk MHЙw}u`3*ptfT -i0Np~mOn);gg5=NuS7uy3_ :n \ No newline at end of file diff --git a/test/integration/filterPath3/expected/repo/.git_keep/objects/c8/68546458601b9c71b76b893f9020ecf7405528 b/test/integration/filterPath3/expected/repo/.git_keep/objects/c8/68546458601b9c71b76b893f9020ecf7405528 deleted file mode 100644 index 5310f486276a186a0fca91a1330e51824963b0e7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 106 zcmV-w0G0oE0V^p=O;s>7He@g~FfcPQQAo?oNoBZXa`Zv?Kci!1uhL(fw)m11d+T)w zlDq+fg^1Oa1^=|Ry$e3{zH{l#M|-E5-a=Af$gp(JAs4j MzzC}q04bP0UJbu9e*gdg diff --git a/test/integration/filterPath3/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 b/test/integration/filterPath3/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 deleted file mode 100644 index 2e9066287..000000000 --- a/test/integration/filterPath3/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 +++ /dev/null @@ -1,2 +0,0 @@ -x+)JMU03c040031QHI5`ֶww.hT[H - yW5Ɨ(| ^-W(x9 \ No newline at end of file diff --git a/test/integration/filterPath3/expected/repo/.git_keep/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 b/test/integration/filterPath3/expected/repo/.git_keep/objects/d2/34c5e057fe32c676ea67e8cb38f4625ddaeb54 deleted file mode 100644 index d39fa7d2fecf1c45a132dfe3a8758952f3c8d968..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21 ccmb}lpN08nuUO8@`> diff --git a/test/integration/filterPath3/expected/repo/.git_keep/objects/db/6681a3e9fb9fb6ef524771cdc763904dd2b54d b/test/integration/filterPath3/expected/repo/.git_keep/objects/db/6681a3e9fb9fb6ef524771cdc763904dd2b54d deleted file mode 100644 index 78eaa8524..000000000 --- a/test/integration/filterPath3/expected/repo/.git_keep/objects/db/6681a3e9fb9fb6ef524771cdc763904dd2b54d +++ /dev/null @@ -1,3 +0,0 @@ -xM -0@a9dEz&`l<=Ƿxemс -EXgr*r,Մ1+fw}u>`CU&08otwO#lD@ diff --git a/test/integration/filterPath3/expected/repo/.git_keep/refs/heads/master b/test/integration/filterPath3/expected/repo/.git_keep/refs/heads/master deleted file mode 100644 index a01c898b5..000000000 --- a/test/integration/filterPath3/expected/repo/.git_keep/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -db6681a3e9fb9fb6ef524771cdc763904dd2b54d diff --git a/test/integration/filterPath3/expected/repo/file b/test/integration/filterPath3/expected/repo/file deleted file mode 100644 index d234c5e05..000000000 --- a/test/integration/filterPath3/expected/repo/file +++ /dev/null @@ -1 +0,0 @@ -test4 diff --git a/test/integration/filterPath3/expected/repo/file0 b/test/integration/filterPath3/expected/repo/file0 deleted file mode 100644 index 38143ad4a..000000000 --- a/test/integration/filterPath3/expected/repo/file0 +++ /dev/null @@ -1 +0,0 @@ -test0 diff --git a/test/integration/filterPath3/expected/repo/file1 b/test/integration/filterPath3/expected/repo/file1 deleted file mode 100644 index a5bce3fd2..000000000 --- a/test/integration/filterPath3/expected/repo/file1 +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/test/integration/filterPath3/expected/repo/file2 b/test/integration/filterPath3/expected/repo/file2 deleted file mode 100644 index d234c5e05..000000000 --- a/test/integration/filterPath3/expected/repo/file2 +++ /dev/null @@ -1 +0,0 @@ -test4 diff --git a/test/integration/filterPath3/recording.json b/test/integration/filterPath3/recording.json deleted file mode 100644 index 6955afb02..000000000 --- a/test/integration/filterPath3/recording.json +++ /dev/null @@ -1 +0,0 @@ -{"KeyEvents":[{"Timestamp":2083,"Mod":0,"Key":256,"Ch":120},{"Timestamp":2419,"Mod":0,"Key":256,"Ch":47},{"Timestamp":2659,"Mod":0,"Key":256,"Ch":102},{"Timestamp":2771,"Mod":0,"Key":256,"Ch":105},{"Timestamp":2835,"Mod":0,"Key":256,"Ch":108},{"Timestamp":2883,"Mod":0,"Key":256,"Ch":116},{"Timestamp":2971,"Mod":0,"Key":256,"Ch":101},{"Timestamp":3027,"Mod":0,"Key":256,"Ch":114},{"Timestamp":3331,"Mod":0,"Key":256,"Ch":45},{"Timestamp":3563,"Mod":0,"Key":256,"Ch":98},{"Timestamp":3627,"Mod":0,"Key":256,"Ch":121},{"Timestamp":4019,"Mod":0,"Key":256,"Ch":45},{"Timestamp":4243,"Mod":0,"Key":256,"Ch":112},{"Timestamp":4355,"Mod":0,"Key":256,"Ch":97},{"Timestamp":4403,"Mod":0,"Key":256,"Ch":116},{"Timestamp":4467,"Mod":0,"Key":256,"Ch":104},{"Timestamp":4676,"Mod":0,"Key":13,"Ch":13},{"Timestamp":5467,"Mod":0,"Key":13,"Ch":13},{"Timestamp":6164,"Mod":0,"Key":13,"Ch":13},{"Timestamp":7339,"Mod":0,"Key":256,"Ch":102},{"Timestamp":7419,"Mod":0,"Key":256,"Ch":105},{"Timestamp":7458,"Mod":0,"Key":256,"Ch":108},{"Timestamp":7515,"Mod":0,"Key":256,"Ch":101},{"Timestamp":7683,"Mod":0,"Key":256,"Ch":49},{"Timestamp":8011,"Mod":0,"Key":13,"Ch":13},{"Timestamp":9419,"Mod":0,"Key":13,"Ch":13},{"Timestamp":11491,"Mod":0,"Key":256,"Ch":32},{"Timestamp":12300,"Mod":2,"Key":16,"Ch":16},{"Timestamp":13122,"Mod":0,"Key":258,"Ch":0},{"Timestamp":13354,"Mod":0,"Key":258,"Ch":0},{"Timestamp":13674,"Mod":0,"Key":13,"Ch":13},{"Timestamp":14887,"Mod":0,"Key":27,"Ch":0},{"Timestamp":15445,"Mod":0,"Key":27,"Ch":0},{"Timestamp":16045,"Mod":0,"Key":27,"Ch":0},{"Timestamp":16602,"Mod":0,"Key":260,"Ch":0},{"Timestamp":16899,"Mod":0,"Key":260,"Ch":0},{"Timestamp":17339,"Mod":0,"Key":256,"Ch":99},{"Timestamp":18467,"Mod":0,"Key":256,"Ch":116},{"Timestamp":18495,"Mod":0,"Key":256,"Ch":101},{"Timestamp":18636,"Mod":0,"Key":256,"Ch":115},{"Timestamp":18667,"Mod":0,"Key":256,"Ch":116},{"Timestamp":18779,"Mod":0,"Key":13,"Ch":13},{"Timestamp":19827,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]} \ No newline at end of file diff --git a/test/integration/filterPath3/setup.sh b/test/integration/filterPath3/setup.sh deleted file mode 100644 index 460b35b25..000000000 --- a/test/integration/filterPath3/setup.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -set -e - -cd $1 - -git init - -git config user.email "CI@example.com" -git config user.name "CI" - -# need a history of commits each containing various files - -echo test0 > file0 -git add . -git commit -am file0 - -echo test1 > file1 -git add . -git commit -am file1 - -echo test2 > file2 -git add . -git commit -am "file2" - -echo test3 > file1 -echo test4 > file2 -git add . -git commit -am "file1 and file2" - -echo test4 > file -git add . -git commit -am "file" diff --git a/test/integration/filterPath3/test.json b/test/integration/filterPath3/test.json deleted file mode 100644 index 682ac9c2f..000000000 --- a/test/integration/filterPath3/test.json +++ /dev/null @@ -1 +0,0 @@ -{ "description": "Open filter path mode from within lazygit", "speed": 10 } From 6c3671f8070c11b81f07d946321bb1dd1e428ff2 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Fri, 30 Dec 2022 22:47:56 +1100 Subject: [PATCH 5/6] appease linter --- pkg/integration/tests/filter_by_path/cli.go | 2 +- pkg/integration/tests/filter_by_path/select_file.go | 4 ++-- pkg/integration/tests/filter_by_path/type_file.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/integration/tests/filter_by_path/cli.go b/pkg/integration/tests/filter_by_path/cli.go index 12e9e91fa..0de95986e 100644 --- a/pkg/integration/tests/filter_by_path/cli.go +++ b/pkg/integration/tests/filter_by_path/cli.go @@ -15,6 +15,6 @@ var CliArg = NewIntegrationTest(NewIntegrationTestArgs{ commonSetup(shell) }, Run: func(t *TestDriver, keys config.KeybindingConfig) { - postFilterTest(t, keys) + postFilterTest(t) }, }) diff --git a/pkg/integration/tests/filter_by_path/select_file.go b/pkg/integration/tests/filter_by_path/select_file.go index a4183de87..6722958dd 100644 --- a/pkg/integration/tests/filter_by_path/select_file.go +++ b/pkg/integration/tests/filter_by_path/select_file.go @@ -34,7 +34,7 @@ var SelectFile = NewIntegrationTest(NewIntegrationTestArgs{ t.ExpectPopup().Menu().Title(Equals("Filtering")).Select(Contains("filter by 'filterFile'")).Confirm() - postFilterTest(t, keys) + postFilterTest(t) }, }) @@ -50,7 +50,7 @@ func commonSetup(shell *Shell) { shell.Commit("only filterFile") } -func postFilterTest(t *TestDriver, keys config.KeybindingConfig) { +func postFilterTest(t *TestDriver) { t.Views().Information().Content(Contains("filtering by 'filterFile'")) t.Views().Commits(). diff --git a/pkg/integration/tests/filter_by_path/type_file.go b/pkg/integration/tests/filter_by_path/type_file.go index 9461635c6..23ec0ff1d 100644 --- a/pkg/integration/tests/filter_by_path/type_file.go +++ b/pkg/integration/tests/filter_by_path/type_file.go @@ -30,6 +30,6 @@ var TypeFile = NewIntegrationTest(NewIntegrationTestArgs{ SuggestionLines(Equals("filterFile")). ConfirmFirstSuggestion() - postFilterTest(t, keys) + postFilterTest(t) }, }) From 5c42e1a5dc1f8201d4f41b29b5e08d2de6c99e17 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Fri, 30 Dec 2022 22:49:08 +1100 Subject: [PATCH 6/6] defend against possible nil function --- pkg/gui/confirmation_panel.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/gui/confirmation_panel.go b/pkg/gui/confirmation_panel.go index b8f79c8a2..4a7822076 100644 --- a/pkg/gui/confirmation_panel.go +++ b/pkg/gui/confirmation_panel.go @@ -290,8 +290,13 @@ func (gui *Gui) clearConfirmationViewKeyBindings() { func (gui *Gui) refreshSuggestions() { gui.suggestionsAsyncHandler.Do(func() func() { - suggestions := gui.findSuggestions(gui.c.GetPromptInput()) - return func() { gui.setSuggestions(suggestions) } + findSuggestionsFn := gui.findSuggestions + if findSuggestionsFn != nil { + suggestions := gui.findSuggestions(gui.c.GetPromptInput()) + return func() { gui.setSuggestions(suggestions) } + } else { + return func() {} + } }) }