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").
|
||||
ArgIf(opts.keepCommitsThatBecomeEmpty && self.version.IsAtLeast(2, 26, 0), "--empty=keep").
|
||||
Arg("--no-autosquash").
|
||||
ArgIf(self.version.IsAtLeast(2, 22, 0), "--rebase-merges").
|
||||
Arg("--rebase-merges").
|
||||
ArgIf(opts.onto != "", "--onto", opts.onto).
|
||||
Arg(opts.baseHashOrRoot).
|
||||
ToArgv()
|
||||
|
|
|
@ -54,16 +54,6 @@ func TestRebaseRebaseBranch(t *testing.T) {
|
|||
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 {
|
||||
|
|
|
@ -10,7 +10,6 @@ var DropMergeCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
|||
Description: "Drops a merge commit outside of an interactive rebase",
|
||||
ExtraCmdArgs: []string{},
|
||||
Skip: false,
|
||||
GitVersion: AtLeast("2.22.0"), // first version that supports the --rebase-merges option
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *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",
|
||||
ExtraCmdArgs: []string{},
|
||||
Skip: false,
|
||||
GitVersion: AtLeast("2.22.0"), // first version that supports the --rebase-merges option
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shared.CreateMergeCommit(shell)
|
||||
|
|
|
@ -10,7 +10,6 @@ var EditRangeSelectOutsideRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
|||
Description: "Select a range of commits to edit outside of a rebase",
|
||||
ExtraCmdArgs: []string{},
|
||||
Skip: false,
|
||||
GitVersion: AtLeast("2.22.0"), // first version that supports the --rebase-merges option
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shared.CreateMergeCommit(shell)
|
||||
|
|
|
@ -29,11 +29,7 @@ var Enter = NewIntegrationTest(NewIntegrationTestArgs{
|
|||
t.Views().Status().Content(Contains("repo"))
|
||||
}
|
||||
assertInSubmodule := func() {
|
||||
if t.Git().Version().IsAtLeast(2, 22, 0) {
|
||||
t.Views().Status().Content(Contains("my_submodule_path(my_submodule_name)"))
|
||||
} else {
|
||||
t.Views().Status().Content(Contains("my_submodule_path"))
|
||||
}
|
||||
t.Views().Status().Content(Contains("my_submodule_path(my_submodule_name)"))
|
||||
}
|
||||
|
||||
assertInParentRepo()
|
||||
|
|
|
@ -37,11 +37,7 @@ var EnterNested = NewIntegrationTest(NewIntegrationTestArgs{
|
|||
// enter the nested submodule
|
||||
PressEnter()
|
||||
|
||||
if t.Git().Version().IsAtLeast(2, 22, 0) {
|
||||
t.Views().Status().Content(Contains("innerSubPath(innerSubName)"))
|
||||
} else {
|
||||
t.Views().Status().Content(Contains("innerSubPath"))
|
||||
}
|
||||
t.Views().Status().Content(Contains("innerSubPath(innerSubName)"))
|
||||
t.Views().Commits().ContainsLines(
|
||||
Contains("initial inner commit"),
|
||||
)
|
||||
|
|
|
@ -31,11 +31,7 @@ var Reset = NewIntegrationTest(NewIntegrationTestArgs{
|
|||
t.Views().Status().Content(Contains("repo"))
|
||||
}
|
||||
assertInSubmodule := func() {
|
||||
if t.Git().Version().IsAtLeast(2, 22, 0) {
|
||||
t.Views().Status().Content(Contains("my_submodule_path(my_submodule_name)"))
|
||||
} else {
|
||||
t.Views().Status().Content(Contains("my_submodule_path"))
|
||||
}
|
||||
t.Views().Status().Content(Contains("my_submodule_path(my_submodule_name)"))
|
||||
}
|
||||
|
||||
assertInParentRepo()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue