mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-10 20:05:50 +02:00
Remove conditional code related to git earlier than 2.22
This commit is contained in:
parent
765168b9d7
commit
82e1caa166
8 changed files with 4 additions and 29 deletions
|
@ -218,7 +218,7 @@ func (self *RebaseCommands) PrepareInteractiveRebaseCommand(opts PrepareInteract
|
||||||
Arg("--keep-empty").
|
Arg("--keep-empty").
|
||||||
ArgIf(opts.keepCommitsThatBecomeEmpty && self.version.IsAtLeast(2, 26, 0), "--empty=keep").
|
ArgIf(opts.keepCommitsThatBecomeEmpty && self.version.IsAtLeast(2, 26, 0), "--empty=keep").
|
||||||
Arg("--no-autosquash").
|
Arg("--no-autosquash").
|
||||||
ArgIf(self.version.IsAtLeast(2, 22, 0), "--rebase-merges").
|
Arg("--rebase-merges").
|
||||||
ArgIf(opts.onto != "", "--onto", opts.onto).
|
ArgIf(opts.onto != "", "--onto", opts.onto).
|
||||||
Arg(opts.baseHashOrRoot).
|
Arg(opts.baseHashOrRoot).
|
||||||
ToArgv()
|
ToArgv()
|
||||||
|
|
|
@ -54,16 +54,6 @@ func TestRebaseRebaseBranch(t *testing.T) {
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
testName: "successful rebase (< 2.22.0)",
|
|
||||||
arg: "master",
|
|
||||||
gitVersion: &GitVersion{2, 21, 9, ""},
|
|
||||||
runner: oscommands.NewFakeRunner(t).
|
|
||||||
ExpectGitArgs([]string{"rebase", "--interactive", "--autostash", "--keep-empty", "--no-autosquash", "master"}, "", nil),
|
|
||||||
test: func(err error) {
|
|
||||||
assert.NoError(t, err)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, s := range scenarios {
|
for _, s := range scenarios {
|
||||||
|
|
|
@ -10,7 +10,6 @@ var DropMergeCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Description: "Drops a merge commit outside of an interactive rebase",
|
Description: "Drops a merge commit outside of an interactive rebase",
|
||||||
ExtraCmdArgs: []string{},
|
ExtraCmdArgs: []string{},
|
||||||
Skip: false,
|
Skip: false,
|
||||||
GitVersion: AtLeast("2.22.0"), // first version that supports the --rebase-merges option
|
|
||||||
SetupConfig: func(config *config.AppConfig) {},
|
SetupConfig: func(config *config.AppConfig) {},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shared.CreateMergeCommit(shell)
|
shared.CreateMergeCommit(shell)
|
||||||
|
|
|
@ -10,7 +10,6 @@ var EditRangeSelectDownToMergeOutsideRebase = NewIntegrationTest(NewIntegrationT
|
||||||
Description: "Select a range of commits (the last one being a merge commit) to edit outside of a rebase",
|
Description: "Select a range of commits (the last one being a merge commit) to edit outside of a rebase",
|
||||||
ExtraCmdArgs: []string{},
|
ExtraCmdArgs: []string{},
|
||||||
Skip: false,
|
Skip: false,
|
||||||
GitVersion: AtLeast("2.22.0"), // first version that supports the --rebase-merges option
|
|
||||||
SetupConfig: func(config *config.AppConfig) {},
|
SetupConfig: func(config *config.AppConfig) {},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shared.CreateMergeCommit(shell)
|
shared.CreateMergeCommit(shell)
|
||||||
|
|
|
@ -10,7 +10,6 @@ var EditRangeSelectOutsideRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
Description: "Select a range of commits to edit outside of a rebase",
|
Description: "Select a range of commits to edit outside of a rebase",
|
||||||
ExtraCmdArgs: []string{},
|
ExtraCmdArgs: []string{},
|
||||||
Skip: false,
|
Skip: false,
|
||||||
GitVersion: AtLeast("2.22.0"), // first version that supports the --rebase-merges option
|
|
||||||
SetupConfig: func(config *config.AppConfig) {},
|
SetupConfig: func(config *config.AppConfig) {},
|
||||||
SetupRepo: func(shell *Shell) {
|
SetupRepo: func(shell *Shell) {
|
||||||
shared.CreateMergeCommit(shell)
|
shared.CreateMergeCommit(shell)
|
||||||
|
|
|
@ -29,11 +29,7 @@ var Enter = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
t.Views().Status().Content(Contains("repo"))
|
t.Views().Status().Content(Contains("repo"))
|
||||||
}
|
}
|
||||||
assertInSubmodule := func() {
|
assertInSubmodule := func() {
|
||||||
if t.Git().Version().IsAtLeast(2, 22, 0) {
|
t.Views().Status().Content(Contains("my_submodule_path(my_submodule_name)"))
|
||||||
t.Views().Status().Content(Contains("my_submodule_path(my_submodule_name)"))
|
|
||||||
} else {
|
|
||||||
t.Views().Status().Content(Contains("my_submodule_path"))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assertInParentRepo()
|
assertInParentRepo()
|
||||||
|
|
|
@ -37,11 +37,7 @@ var EnterNested = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
// enter the nested submodule
|
// enter the nested submodule
|
||||||
PressEnter()
|
PressEnter()
|
||||||
|
|
||||||
if t.Git().Version().IsAtLeast(2, 22, 0) {
|
t.Views().Status().Content(Contains("innerSubPath(innerSubName)"))
|
||||||
t.Views().Status().Content(Contains("innerSubPath(innerSubName)"))
|
|
||||||
} else {
|
|
||||||
t.Views().Status().Content(Contains("innerSubPath"))
|
|
||||||
}
|
|
||||||
t.Views().Commits().ContainsLines(
|
t.Views().Commits().ContainsLines(
|
||||||
Contains("initial inner commit"),
|
Contains("initial inner commit"),
|
||||||
)
|
)
|
||||||
|
|
|
@ -31,11 +31,7 @@ var Reset = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
t.Views().Status().Content(Contains("repo"))
|
t.Views().Status().Content(Contains("repo"))
|
||||||
}
|
}
|
||||||
assertInSubmodule := func() {
|
assertInSubmodule := func() {
|
||||||
if t.Git().Version().IsAtLeast(2, 22, 0) {
|
t.Views().Status().Content(Contains("my_submodule_path(my_submodule_name)"))
|
||||||
t.Views().Status().Content(Contains("my_submodule_path(my_submodule_name)"))
|
|
||||||
} else {
|
|
||||||
t.Views().Status().Content(Contains("my_submodule_path"))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assertInParentRepo()
|
assertInParentRepo()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue