diff --git a/pkg/integration/README.md b/pkg/integration/README.md index 616e09e98..889058d89 100644 --- a/pkg/integration/README.md +++ b/pkg/integration/README.md @@ -79,6 +79,8 @@ To run a test in sandbox mode you can press 's' on a test in the test TUI or in ## Migration process +You can watch how to migrate tests in this youtube [video](https://youtu.be/cJtOJu6-HcA). + At the time of writing, most tests are created under an old approach, where you would record yourself in a lazygit session and then the test would replay the keybindings with the same timestamps. This old approach is great for writing tests quickly, but is much harder to maintain. It has to rely on snapshots to determining if a test passes or fails, and can't do assertions along the way. It's also harder to grok what's the intention behind certain actions that take place within the test (e.g. was the recorder intentionally switching to another panel or was that just a misclick?). At the moment, all the deprecated test code lives in pkg/integration/deprecated. Hopefully in the very near future we migrate everything across so that we don't need to maintain two systems. diff --git a/pkg/integration/components/file_system.go b/pkg/integration/components/file_system.go index 040234e77..4ac064838 100644 --- a/pkg/integration/components/file_system.go +++ b/pkg/integration/components/file_system.go @@ -24,3 +24,26 @@ func (self *FileSystem) PathNotPresent(path string) { return os.IsNotExist(err), fmt.Sprintf("Expected path '%s' to not exist, but it does", path) }) } + +// Asserts that the file at the given path has the given content +func (self *FileSystem) FileContent(path string, matcher *matcher) { + self.assertWithRetries(func() (bool, string) { + _, err := os.Stat(path) + if os.IsNotExist(err) { + return false, fmt.Sprintf("Expected path '%s' to not exist, but it does", path) + } + + output, err := os.ReadFile(path) + if err != nil { + return false, fmt.Sprintf("Expected error when reading file content at path '%s': %s", path, err.Error()) + } + + strOutput := string(output) + + if ok, errMsg := matcher.context("").test(strOutput); !ok { + return false, fmt.Sprintf("Unexpected content in file %s: %s", path, errMsg) + } + + return true, "" + }) +} diff --git a/pkg/integration/tests/commit/discard_old_file_change.go b/pkg/integration/tests/commit/discard_old_file_change.go new file mode 100644 index 000000000..735dcca87 --- /dev/null +++ b/pkg/integration/tests/commit/discard_old_file_change.go @@ -0,0 +1,57 @@ +package commit + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var DiscardOldFileChange = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Discarding a single file from an old commit (does rebase in background to remove the file but retain the other one)", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(config *config.AppConfig) {}, + SetupRepo: func(shell *Shell) { + shell.CreateFileAndAdd("file0", "file0") + shell.Commit("first commit") + + shell.CreateFileAndAdd("file1", "file2") + shell.CreateFileAndAdd("fileToRemove", "fileToRemove") + shell.Commit("commit to change") + + shell.CreateFileAndAdd("file3", "file3") + shell.Commit("third commit") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Commits(). + Focus(). + Lines( + Contains("third commit").IsSelected(), + Contains("commit to change"), + Contains("first commit"), + ). + SelectNextItem(). + PressEnter() + + t.Views().CommitFiles(). + IsFocused(). + Lines( + Contains("file1").IsSelected(), + Contains("fileToRemove"), + ). + SelectNextItem(). + Press(keys.Universal.Remove) + + t.ExpectPopup().Confirmation(). + Title(Equals("Discard file changes")). + Content(Contains("Are you sure you want to discard this commit's changes to this file?")). + Confirm() + + t.Views().CommitFiles(). + IsFocused(). + Lines( + Contains("file1").IsSelected(), + ) + + t.FileSystem().PathNotPresent("fileToRemove") + }, +}) diff --git a/pkg/integration/tests/file/discard_staged_changes.go b/pkg/integration/tests/file/discard_staged_changes.go new file mode 100644 index 000000000..728df8898 --- /dev/null +++ b/pkg/integration/tests/file/discard_staged_changes.go @@ -0,0 +1,52 @@ +package file + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var DiscardStagedChanges = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Discarding staged changes", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(config *config.AppConfig) { + }, + SetupRepo: func(shell *Shell) { + shell.CreateFileAndAdd("fileToRemove", "original content") + shell.CreateFileAndAdd("file2", "original content") + shell.Commit("first commit") + + shell.CreateFile("file3", "original content") + shell.UpdateFile("fileToRemove", "new content") + shell.UpdateFile("file2", "new content") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Files(). + IsFocused(). + Lines( + Contains(` M file2`).IsSelected(), + Contains(` M fileToRemove`), + Contains(`?? file3`), + ). + SelectNextItem(). + PressPrimaryAction(). + Lines( + Contains(` M file2`), + Contains(`M fileToRemove`).IsSelected(), + Contains(`?? file3`), + ). + Press(keys.Files.ViewResetOptions) + + t.ExpectPopup().Menu().Title(Equals("")).Select(Contains("discard staged changes")).Confirm() + + // staged file has been removed + t.Views().Files(). + Lines( + Contains(` M file2`), + Contains(`?? file3`).IsSelected(), + ) + + // the file should have the same content that it originally had, given that that was committed already + t.FileSystem().FileContent("fileToRemove", Equals("original content")) + }, +}) diff --git a/pkg/integration/tests/file/exclude_gitignore.go b/pkg/integration/tests/file/exclude_gitignore.go new file mode 100644 index 000000000..10ea62f15 --- /dev/null +++ b/pkg/integration/tests/file/exclude_gitignore.go @@ -0,0 +1,39 @@ +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/tests.go b/pkg/integration/tests/tests.go index d63b1aa50..da72f84ed 100644 --- a/pkg/integration/tests/tests.go +++ b/pkg/integration/tests/tests.go @@ -45,6 +45,7 @@ var tests = []*components.IntegrationTest{ commit.Staged, commit.Unstaged, commit.StagedWithoutHooks, + commit.DiscardOldFileChange, custom_commands.Basic, custom_commands.FormPrompts, custom_commands.MenuFromCommand, @@ -52,6 +53,8 @@ var tests = []*components.IntegrationTest{ custom_commands.MultiplePrompts, file.DirWithUntrackedFile, file.DiscardChanges, + file.DiscardStagedChanges, + file.ExcludeGitignore, interactive_rebase.AmendMerge, interactive_rebase.One, stash.Rename, diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/discardOldFileChanges/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 7b27632fe..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -twoFiles diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/FETCH_HEAD b/test/integration/discardOldFileChanges/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/HEAD b/test/integration/discardOldFileChanges/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/ORIG_HEAD b/test/integration/discardOldFileChanges/expected/repo/.git_keep/ORIG_HEAD deleted file mode 100644 index db70e637d..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -7880a9728615a4d196df39600a0c8c71b40d96d6 diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/config b/test/integration/discardOldFileChanges/expected/repo/.git_keep/config deleted file mode 100644 index 8ae104545..000000000 --- a/test/integration/discardOldFileChanges/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/discardOldFileChanges/expected/repo/.git_keep/description b/test/integration/discardOldFileChanges/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/discardOldFileChanges/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/discardOldFileChanges/expected/repo/.git_keep/index b/test/integration/discardOldFileChanges/expected/repo/.git_keep/index deleted file mode 100644 index 258123f26..000000000 Binary files a/test/integration/discardOldFileChanges/expected/repo/.git_keep/index and /dev/null differ diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/info/exclude b/test/integration/discardOldFileChanges/expected/repo/.git_keep/info/exclude deleted file mode 100644 index 8e9f2071f..000000000 --- a/test/integration/discardOldFileChanges/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/discardOldFileChanges/expected/repo/.git_keep/logs/HEAD b/test/integration/discardOldFileChanges/expected/repo/.git_keep/logs/HEAD deleted file mode 100644 index cd7bc3c77..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/logs/HEAD +++ /dev/null @@ -1,9 +0,0 @@ -0000000000000000000000000000000000000000 b7a702b642978f2a9b1af9c1c67b22127af78c92 CI 1641697108 +1100 commit (initial): file0 -b7a702b642978f2a9b1af9c1c67b22127af78c92 7880a9728615a4d196df39600a0c8c71b40d96d6 CI 1641697108 +1100 commit: twoFiles -7880a9728615a4d196df39600a0c8c71b40d96d6 af6725ba23f43a286deff0747476d7874113df1e CI 1641697108 +1100 commit: file2 -af6725ba23f43a286deff0747476d7874113df1e af6725ba23f43a286deff0747476d7874113df1e CI 1641697111 +1100 rebase: updating HEAD -af6725ba23f43a286deff0747476d7874113df1e b7a702b642978f2a9b1af9c1c67b22127af78c92 CI 1641697111 +1100 rebase -i (start): checkout b7a702b642978f2a9b1af9c1c67b22127af78c92 -b7a702b642978f2a9b1af9c1c67b22127af78c92 7880a9728615a4d196df39600a0c8c71b40d96d6 CI 1641697111 +1100 rebase -i: fast-forward -7880a9728615a4d196df39600a0c8c71b40d96d6 d14505f281a54cda96fc5fb8cd4b4ee14bae6264 CI 1641697111 +1100 commit (amend): twoFiles -d14505f281a54cda96fc5fb8cd4b4ee14bae6264 225ad83faa797c1831a2bc956a21e2d472f21443 CI 1641697111 +1100 rebase -i (pick): file2 -225ad83faa797c1831a2bc956a21e2d472f21443 225ad83faa797c1831a2bc956a21e2d472f21443 CI 1641697111 +1100 rebase -i (finish): returning to refs/heads/master diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/discardOldFileChanges/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index 13413542d..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1,4 +0,0 @@ -0000000000000000000000000000000000000000 b7a702b642978f2a9b1af9c1c67b22127af78c92 CI 1641697108 +1100 commit (initial): file0 -b7a702b642978f2a9b1af9c1c67b22127af78c92 7880a9728615a4d196df39600a0c8c71b40d96d6 CI 1641697108 +1100 commit: twoFiles -7880a9728615a4d196df39600a0c8c71b40d96d6 af6725ba23f43a286deff0747476d7874113df1e CI 1641697108 +1100 commit: file2 -af6725ba23f43a286deff0747476d7874113df1e 225ad83faa797c1831a2bc956a21e2d472f21443 CI 1641697111 +1100 rebase -i (finish): refs/heads/master onto b7a702b642978f2a9b1af9c1c67b22127af78c92 diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/00/cbccfd35a05ef9373bba9d5633cf6e67f83dd5 b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/00/cbccfd35a05ef9373bba9d5633cf6e67f83dd5 deleted file mode 100644 index fd478c4af..000000000 Binary files a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/00/cbccfd35a05ef9373bba9d5633cf6e67f83dd5 and /dev/null differ diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/0a/91dcf3772f7fd7409b3df04eb6ef177219303a b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/0a/91dcf3772f7fd7409b3df04eb6ef177219303a deleted file mode 100644 index 2794a5840..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/0a/91dcf3772f7fd7409b3df04eb6ef177219303a +++ /dev/null @@ -1 +0,0 @@ -xj1DSW]iO+ \VD>s'C>?j҇n Wzd9Vc\3{Z3VeSD.>~-C >Eրi&*'&Ġ 폇%aZԨ*G)L"qvwl?V0̈^/w͙r~K \ No newline at end of file diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/0c/db6daba7e25b6d6d10da326e0ab74401021370 b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/0c/db6daba7e25b6d6d10da326e0ab74401021370 deleted file mode 100644 index 798edd72c..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/0c/db6daba7e25b6d6d10da326e0ab74401021370 +++ /dev/null @@ -1,2 +0,0 @@ -xA -0E]$DDzi2iK㛍{yZ\ .%xJNO|S{[{`Qx;1`7+ \ No newline at end of file diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/d0/76cc9cc09acaa2d36fbc7a95fd3e2306494641 deleted file mode 100644 index 2e9066287..000000000 --- a/test/integration/discardOldFileChanges/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/discardOldFileChanges/expected/repo/.git_keep/objects/d1/4505f281a54cda96fc5fb8cd4b4ee14bae6264 b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/d1/4505f281a54cda96fc5fb8cd4b4ee14bae6264 deleted file mode 100644 index 76e9da484..000000000 Binary files a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/d1/4505f281a54cda96fc5fb8cd4b4ee14bae6264 and /dev/null differ diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b b/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b deleted file mode 100644 index 9b771fc2f..000000000 Binary files a/test/integration/discardOldFileChanges/expected/repo/.git_keep/objects/df/6b0d2bcc76e6ec0fca20c227104a4f28bac41b and /dev/null differ diff --git a/test/integration/discardOldFileChanges/expected/repo/.git_keep/refs/heads/master b/test/integration/discardOldFileChanges/expected/repo/.git_keep/refs/heads/master deleted file mode 100644 index 2ebac56f2..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/.git_keep/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -225ad83faa797c1831a2bc956a21e2d472f21443 diff --git a/test/integration/discardOldFileChanges/expected/repo/file0 b/test/integration/discardOldFileChanges/expected/repo/file0 deleted file mode 100644 index 38143ad4a..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/file0 +++ /dev/null @@ -1 +0,0 @@ -test0 diff --git a/test/integration/discardOldFileChanges/expected/repo/file1 b/test/integration/discardOldFileChanges/expected/repo/file1 deleted file mode 100644 index a5bce3fd2..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/file1 +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/test/integration/discardOldFileChanges/expected/repo/file2 b/test/integration/discardOldFileChanges/expected/repo/file2 deleted file mode 100644 index 180cf8328..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/file2 +++ /dev/null @@ -1 +0,0 @@ -test2 diff --git a/test/integration/discardOldFileChanges/expected/repo/file3 b/test/integration/discardOldFileChanges/expected/repo/file3 deleted file mode 100644 index df6b0d2bc..000000000 --- a/test/integration/discardOldFileChanges/expected/repo/file3 +++ /dev/null @@ -1 +0,0 @@ -test3 diff --git a/test/integration/discardOldFileChanges/recording.json b/test/integration/discardOldFileChanges/recording.json deleted file mode 100644 index 0b9a99ec5..000000000 --- a/test/integration/discardOldFileChanges/recording.json +++ /dev/null @@ -1 +0,0 @@ -{"KeyEvents":[{"Timestamp":635,"Mod":0,"Key":259,"Ch":0},{"Timestamp":899,"Mod":0,"Key":259,"Ch":0},{"Timestamp":1227,"Mod":0,"Key":258,"Ch":0},{"Timestamp":1571,"Mod":0,"Key":13,"Ch":13},{"Timestamp":1971,"Mod":0,"Key":258,"Ch":0},{"Timestamp":2322,"Mod":0,"Key":256,"Ch":100},{"Timestamp":2731,"Mod":0,"Key":13,"Ch":13},{"Timestamp":3707,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]} \ No newline at end of file diff --git a/test/integration/discardOldFileChanges/setup.sh b/test/integration/discardOldFileChanges/setup.sh deleted file mode 100644 index 5b592cabd..000000000 --- a/test/integration/discardOldFileChanges/setup.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -set -e - -cd $1 - -git init - -git config user.email "CI@example.com" -git config user.name "CI" - -echo test0 > file0 -git add . -git commit -am file0 - -echo test1 > file1 -echo testZ > fileZ -git add . -git commit -am twoFiles - -echo test2 > file2 -git add . -git commit -am file2 - -echo test3 > file3 -git add . diff --git a/test/integration/discardOldFileChanges/test.json b/test/integration/discardOldFileChanges/test.json deleted file mode 100644 index 04a59a63c..000000000 --- a/test/integration/discardOldFileChanges/test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "description": "Discarding a single file from an old commit (does rebase in background to remove the file but retain the other one)", - "speed": 5 -} diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/discardStagedFiles/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 6c493ff74..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -file2 diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/FETCH_HEAD b/test/integration/discardStagedFiles/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/HEAD b/test/integration/discardStagedFiles/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/ORIG_HEAD b/test/integration/discardStagedFiles/expected/repo/.git_keep/ORIG_HEAD deleted file mode 100644 index c3e34c41d..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/ORIG_HEAD +++ /dev/null @@ -1 +0,0 @@ -02f629e46dbaa03b58196cced3df07b02c0daf22 diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/config b/test/integration/discardStagedFiles/expected/repo/.git_keep/config deleted file mode 100644 index 596ebaeb3..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/config +++ /dev/null @@ -1,8 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true -[user] - email = CI@example.com - name = CI diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/description b/test/integration/discardStagedFiles/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/discardStagedFiles/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/discardStagedFiles/expected/repo/.git_keep/index b/test/integration/discardStagedFiles/expected/repo/.git_keep/index deleted file mode 100644 index be47b0322..000000000 Binary files a/test/integration/discardStagedFiles/expected/repo/.git_keep/index and /dev/null differ diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/info/exclude b/test/integration/discardStagedFiles/expected/repo/.git_keep/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/test/integration/discardStagedFiles/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/discardStagedFiles/expected/repo/.git_keep/logs/HEAD b/test/integration/discardStagedFiles/expected/repo/.git_keep/logs/HEAD deleted file mode 100644 index 9afe44c14..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/logs/HEAD +++ /dev/null @@ -1,5 +0,0 @@ -0000000000000000000000000000000000000000 22f24c5fcc97c1ff826ecb66b60bdc01937f6052 CI 1652009263 +0200 commit (initial): file0 -22f24c5fcc97c1ff826ecb66b60bdc01937f6052 9e7ff93a5c67a0ef098e9e436961746f333edf98 CI 1652009263 +0200 commit: file1 -9e7ff93a5c67a0ef098e9e436961746f333edf98 02f629e46dbaa03b58196cced3df07b02c0daf22 CI 1652009263 +0200 commit: file2 -02f629e46dbaa03b58196cced3df07b02c0daf22 02f629e46dbaa03b58196cced3df07b02c0daf22 CI 1652009266 +0200 reset: moving to HEAD -02f629e46dbaa03b58196cced3df07b02c0daf22 02f629e46dbaa03b58196cced3df07b02c0daf22 CI 1652009266 +0200 reset: moving to HEAD diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/discardStagedFiles/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index e5e4b05c6..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1,3 +0,0 @@ -0000000000000000000000000000000000000000 22f24c5fcc97c1ff826ecb66b60bdc01937f6052 CI 1652009263 +0200 commit (initial): file0 -22f24c5fcc97c1ff826ecb66b60bdc01937f6052 9e7ff93a5c67a0ef098e9e436961746f333edf98 CI 1652009263 +0200 commit: file1 -9e7ff93a5c67a0ef098e9e436961746f333edf98 02f629e46dbaa03b58196cced3df07b02c0daf22 CI 1652009263 +0200 commit: file2 diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/02/f629e46dbaa03b58196cced3df07b02c0daf22 b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/02/f629e46dbaa03b58196cced3df07b02c0daf22 deleted file mode 100644 index 5dd10885d..000000000 Binary files a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/02/f629e46dbaa03b58196cced3df07b02c0daf22 and /dev/null differ diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 deleted file mode 100644 index f74bf2335..000000000 Binary files a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/18/0cf8328022becee9aaa2577a8f84ea2b9f3827 and /dev/null differ diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 deleted file mode 100644 index 79fcadf67..000000000 Binary files a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/1e/3e67b999db1576ad1ee08bf4f02bdf29e49442 and /dev/null differ diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/22/f24c5fcc97c1ff826ecb66b60bdc01937f6052 b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/22/f24c5fcc97c1ff826ecb66b60bdc01937f6052 deleted file mode 100644 index f4e1952b1..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/22/f24c5fcc97c1ff826ecb66b60bdc01937f6052 +++ /dev/null @@ -1,3 +0,0 @@ -x -0=+.&ݦ.=3 )%o>0 ZKYK;২)q!Y1KfSv -Qg§IByyʱ$GǬtN>i37y2+ \ No newline at end of file diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da deleted file mode 100644 index 06c9cb73d..000000000 Binary files a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/38/143ad4a0fe2ab6ee53c2ef89a5d9e2bd9535da and /dev/null differ diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/5c/ef9afea6a37d89f925e24ebf71adecb63d1f07 b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/5c/ef9afea6a37d89f925e24ebf71adecb63d1f07 deleted file mode 100644 index 6a6f24362..000000000 Binary files a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/5c/ef9afea6a37d89f925e24ebf71adecb63d1f07 and /dev/null differ diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/5e/2f5743436bdc7602aa3486d5ff294940603c3d b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/5e/2f5743436bdc7602aa3486d5ff294940603c3d deleted file mode 100644 index 7aee98aa9..000000000 Binary files a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/5e/2f5743436bdc7602aa3486d5ff294940603c3d and /dev/null differ diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/66/bbc809cdafd867cf9320bfb7484bb8fa898448 b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/66/bbc809cdafd867cf9320bfb7484bb8fa898448 deleted file mode 100644 index c84b87a17..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/66/bbc809cdafd867cf9320bfb7484bb8fa898448 +++ /dev/null @@ -1,3 +0,0 @@ -x+)JMUd040031QHI5`ֶww.hT[H - e"ǨS,gu"YH -$x~5(;rբW-Ж+^ \ No newline at end of file diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/9d/b161bba78fbd20e7e4ae004be28e40d747726a b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/9d/b161bba78fbd20e7e4ae004be28e40d747726a deleted file mode 100644 index c5c3d1d48..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/9d/b161bba78fbd20e7e4ae004be28e40d747726a +++ /dev/null @@ -1,2 +0,0 @@ -x -0D=+.vn<3 -5o.޽ üŵu,BNǘ}O(YF묈yg3[uZN2sqȄw};'ܧ~BٞzkB!zb#dZۤ97%uYAJ  BP \ No newline at end of file diff --git a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/9e/7ff93a5c67a0ef098e9e436961746f333edf98 b/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/9e/7ff93a5c67a0ef098e9e436961746f333edf98 deleted file mode 100644 index 1c2077cd7..000000000 --- a/test/integration/discardStagedFiles/expected/repo/.git_keep/objects/9e/7ff93a5c67a0ef098e9e436961746f333edf98 +++ /dev/null @@ -1,2 +0,0 @@ -xA -0E] 2$"BW=F2D>K."A" p) 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 "hello there" > file1 -echo "hello there" > file2 -echo "hello there" > file3 diff --git a/test/integration/discardStagedFiles/test.json b/test/integration/discardStagedFiles/test.json deleted file mode 100644 index 9edc4a815..000000000 --- a/test/integration/discardStagedFiles/test.json +++ /dev/null @@ -1 +0,0 @@ -{ "description": "Discarding staged changes", "speed": 5 } diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/excludeGitIgnore/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 5852f4463..000000000 --- a/test/integration/excludeGitIgnore/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -Initial commit diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/FETCH_HEAD b/test/integration/excludeGitIgnore/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/HEAD b/test/integration/excludeGitIgnore/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/excludeGitIgnore/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/config b/test/integration/excludeGitIgnore/expected/repo/.git_keep/config deleted file mode 100644 index 8ae104545..000000000 --- a/test/integration/excludeGitIgnore/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/excludeGitIgnore/expected/repo/.git_keep/description b/test/integration/excludeGitIgnore/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/excludeGitIgnore/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/excludeGitIgnore/expected/repo/.git_keep/index b/test/integration/excludeGitIgnore/expected/repo/.git_keep/index deleted file mode 100644 index 65d675154..000000000 Binary files a/test/integration/excludeGitIgnore/expected/repo/.git_keep/index and /dev/null differ diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/info/exclude b/test/integration/excludeGitIgnore/expected/repo/.git_keep/info/exclude deleted file mode 100644 index 8e9f2071f..000000000 --- a/test/integration/excludeGitIgnore/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/excludeGitIgnore/expected/repo/.git_keep/logs/HEAD b/test/integration/excludeGitIgnore/expected/repo/.git_keep/logs/HEAD deleted file mode 100644 index bad114b22..000000000 --- a/test/integration/excludeGitIgnore/expected/repo/.git_keep/logs/HEAD +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 e976bc07c8784964cf239ac9fbdc3535df55269c CI 1657012812 +1000 commit (initial): Initial commit diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/excludeGitIgnore/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index bad114b22..000000000 --- a/test/integration/excludeGitIgnore/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 e976bc07c8784964cf239ac9fbdc3535df55269c CI 1657012812 +1000 commit (initial): Initial commit diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 b/test/integration/excludeGitIgnore/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 deleted file mode 100644 index adf64119a..000000000 Binary files a/test/integration/excludeGitIgnore/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 and /dev/null differ diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/objects/e9/76bc07c8784964cf239ac9fbdc3535df55269c b/test/integration/excludeGitIgnore/expected/repo/.git_keep/objects/e9/76bc07c8784964cf239ac9fbdc3535df55269c deleted file mode 100644 index 9803ebd13..000000000 Binary files a/test/integration/excludeGitIgnore/expected/repo/.git_keep/objects/e9/76bc07c8784964cf239ac9fbdc3535df55269c and /dev/null differ diff --git a/test/integration/excludeGitIgnore/expected/repo/.git_keep/refs/heads/master b/test/integration/excludeGitIgnore/expected/repo/.git_keep/refs/heads/master deleted file mode 100644 index 364cd7031..000000000 --- a/test/integration/excludeGitIgnore/expected/repo/.git_keep/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -e976bc07c8784964cf239ac9fbdc3535df55269c diff --git a/test/integration/excludeGitIgnore/expected/repo/lg_ignore_file b/test/integration/excludeGitIgnore/expected/repo/lg_ignore_file deleted file mode 100644 index a5bce3fd2..000000000 --- a/test/integration/excludeGitIgnore/expected/repo/lg_ignore_file +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/test/integration/excludeGitIgnore/recording.json b/test/integration/excludeGitIgnore/recording.json deleted file mode 100644 index 9c332fe93..000000000 --- a/test/integration/excludeGitIgnore/recording.json +++ /dev/null @@ -1 +0,0 @@ -{"KeyEvents":[{"Timestamp":642,"Mod":0,"Key":256,"Ch":105},{"Timestamp":1529,"Mod":0,"Key":256,"Ch":101},{"Timestamp":2522,"Mod":0,"Key":27,"Ch":0},{"Timestamp":2962,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":238,"Height":61}]} \ No newline at end of file diff --git a/test/integration/excludeGitIgnore/setup.sh b/test/integration/excludeGitIgnore/setup.sh deleted file mode 100644 index f0c6f3c8f..000000000 --- a/test/integration/excludeGitIgnore/setup.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -set -e - -cd $1 - -git init - -git config user.email "CI@example.com" -git config user.name "CI" - -git commit --allow-empty -m "Initial commit" - -echo test1 > .gitignore - diff --git a/test/integration/excludeGitIgnore/test.json b/test/integration/excludeGitIgnore/test.json deleted file mode 100644 index 9c466ba11..000000000 --- a/test/integration/excludeGitIgnore/test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "description": "In this test we attempt to add .gitignore to .git/info/exclude to ensure lazygit rejects the action", - "speed": 5 -}