summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/integration/tests')
-rw-r--r--pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref.go2
-rw-r--r--pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref_show_branch_heads.go2
-rw-r--r--pkg/integration/tests/patch_building/move_to_earlier_commit.go1
-rw-r--r--pkg/integration/tests/patch_building/move_to_earlier_commit_no_keep_empty.go77
-rw-r--r--pkg/integration/tests/test_list.go1
5 files changed, 81 insertions, 2 deletions
diff --git a/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref.go b/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref.go
index ace5bed40..e8d1e170a 100644
--- a/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref.go
+++ b/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref.go
@@ -9,7 +9,7 @@ var DropTodoCommitWithUpdateRef = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Drops a commit during interactive rebase when there is an update-ref in the git-rebase-todo file",
ExtraCmdArgs: "",
Skip: false,
- GitVersion: From("2.38.0"),
+ GitVersion: AtLeast("2.38.0"),
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.
diff --git a/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref_show_branch_heads.go b/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref_show_branch_heads.go
index cb42ce989..6321891a7 100644
--- a/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref_show_branch_heads.go
+++ b/pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref_show_branch_heads.go
@@ -9,7 +9,7 @@ var DropTodoCommitWithUpdateRefShowBranchHeads = NewIntegrationTest(NewIntegrati
Description: "Drops a commit during interactive rebase when there is an update-ref in the git-rebase-todo file (with experimentalShowBranchHeads on)",
ExtraCmdArgs: "",
Skip: false,
- GitVersion: From("2.38.0"),
+ GitVersion: AtLeast("2.38.0"),
SetupConfig: func(config *config.AppConfig) {
config.UserConfig.Gui.ExperimentalShowBranchHeads = true
},
diff --git a/pkg/integration/tests/patch_building/move_to_earlier_commit.go b/pkg/integration/tests/patch_building/move_to_earlier_commit.go
index 5803737f0..98bf6fa05 100644
--- a/pkg/integration/tests/patch_building/move_to_earlier_commit.go
+++ b/pkg/integration/tests/patch_building/move_to_earlier_commit.go
@@ -9,6 +9,7 @@ var MoveToEarlierCommit = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Move a patch from a commit to an earlier commit",
ExtraCmdArgs: "",
Skip: false,
+ GitVersion: AtLeast("2.26.0"),
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.CreateDir("dir")
diff --git a/pkg/integration/tests/patch_building/move_to_earlier_commit_no_keep_empty.go b/pkg/integration/tests/patch_building/move_to_earlier_commit_no_keep_empty.go
new file mode 100644
index 000000000..a44ba3438
--- /dev/null
+++ b/pkg/integration/tests/patch_building/move_to_earlier_commit_no_keep_empty.go
@@ -0,0 +1,77 @@
+package patch_building
+
+import (
+ "github.com/jesseduffield/lazygit/pkg/config"
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
+)
+
+var MoveToEarlierCommitNoKeepEmpty = NewIntegrationTest(NewIntegrationTestArgs{
+ Description: "Move a patch from a commit to an earlier commit, for older git versions that don't keep the empty commit",
+ ExtraCmdArgs: "",
+ Skip: false,
+ GitVersion: Before("2.26.0"),
+ SetupConfig: func(config *config.AppConfig) {},
+ SetupRepo: func(shell *Shell) {
+ shell.CreateDir("dir")
+ shell.CreateFileAndAdd("dir/file1", "file1 content")
+ shell.CreateFileAndAdd("dir/file2", "file2 content")
+ shell.Commit("first commit")
+
+ shell.CreateFileAndAdd("unrelated-file", "")
+ shell.Commit("destination commit")
+
+ shell.UpdateFileAndAdd("dir/file1", "file1 content with old changes")
+ shell.DeleteFileAndAdd("dir/file2")
+ shell.CreateFileAndAdd("dir/file3", "file3 content")
+ shell.Commit("commit to move from")
+ },
+ Run: func(t *TestDriver, keys config.KeybindingConfig) {
+ t.Views().Commits().
+ Focus().
+ Lines(
+ Contains("commit to move from").IsSelected(),
+ Contains("destination commit"),
+ Contains("first commit"),
+ ).
+ PressEnter()
+
+ t.Views().CommitFiles().
+ IsFocused().
+ Lines(
+ Contains("dir").IsSelected(),
+ Contains(" M file1"),
+ Contains(" D file2"),
+ Contains(" A file3"),
+ ).
+ PressPrimaryAction().
+ PressEscape()
+
+ t.Views().Information().Content(Contains("building patch"))
+
+ t.Views().Commits().
+ IsFocused().
+ SelectNextItem()
+
+ t.Common().SelectPatchOption(Contains("move patch to selected commit"))
+
+ t.Views().Commits().
+ IsFocused().
+ Lines(
+ Contains("destination commit"),
+ Contains("first commit").IsSelected(),
+ ).
+ SelectPreviousItem().
+ PressEnter()
+
+ t.Views().CommitFiles().
+ IsFocused().
+ Lines(
+ Contains("dir").IsSelected(),
+ Contains(" M file1"),
+ Contains(" D file2"),
+ Contains(" A file3"),
+ Contains("A unrelated-file"),
+ ).
+ PressEscape()
+ },
+})
diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go
index b2cb12e14..fe6604ac1 100644
--- a/pkg/integration/tests/test_list.go
+++ b/pkg/integration/tests/test_list.go
@@ -117,6 +117,7 @@ var tests = []*components.IntegrationTest{
patch_building.ApplyInReverseWithConflict,
patch_building.CopyPatchToClipboard,
patch_building.MoveToEarlierCommit,
+ patch_building.MoveToEarlierCommitNoKeepEmpty,
patch_building.MoveToIndex,
patch_building.MoveToIndexPartOfAdjacentAddedLines,
patch_building.MoveToIndexPartial,