Skip to content

Commit 82e1caa

Browse files
committed
Remove conditional code related to git earlier than 2.22
1 parent 765168b commit 82e1caa

File tree

8 files changed

+4
-29
lines changed

8 files changed

+4
-29
lines changed

pkg/commands/git_commands/rebase.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func (self *RebaseCommands) PrepareInteractiveRebaseCommand(opts PrepareInteract
218218
Arg("--keep-empty").
219219
ArgIf(opts.keepCommitsThatBecomeEmpty && self.version.IsAtLeast(2, 26, 0), "--empty=keep").
220220
Arg("--no-autosquash").
221-
ArgIf(self.version.IsAtLeast(2, 22, 0), "--rebase-merges").
221+
Arg("--rebase-merges").
222222
ArgIf(opts.onto != "", "--onto", opts.onto).
223223
Arg(opts.baseHashOrRoot).
224224
ToArgv()

pkg/commands/git_commands/rebase_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,6 @@ func TestRebaseRebaseBranch(t *testing.T) {
5454
assert.NoError(t, err)
5555
},
5656
},
57-
{
58-
testName: "successful rebase (< 2.22.0)",
59-
arg: "master",
60-
gitVersion: &GitVersion{2, 21, 9, ""},
61-
runner: oscommands.NewFakeRunner(t).
62-
ExpectGitArgs([]string{"rebase", "--interactive", "--autostash", "--keep-empty", "--no-autosquash", "master"}, "", nil),
63-
test: func(err error) {
64-
assert.NoError(t, err)
65-
},
66-
},
6757
}
6858

6959
for _, s := range scenarios {

pkg/integration/tests/interactive_rebase/drop_merge_commit.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ var DropMergeCommit = NewIntegrationTest(NewIntegrationTestArgs{
1010
Description: "Drops a merge commit outside of an interactive rebase",
1111
ExtraCmdArgs: []string{},
1212
Skip: false,
13-
GitVersion: AtLeast("2.22.0"), // first version that supports the --rebase-merges option
1413
SetupConfig: func(config *config.AppConfig) {},
1514
SetupRepo: func(shell *Shell) {
1615
shared.CreateMergeCommit(shell)

pkg/integration/tests/interactive_rebase/edit_range_select_down_to_merge_outside_rebase.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ var EditRangeSelectDownToMergeOutsideRebase = NewIntegrationTest(NewIntegrationT
1010
Description: "Select a range of commits (the last one being a merge commit) to edit outside of a rebase",
1111
ExtraCmdArgs: []string{},
1212
Skip: false,
13-
GitVersion: AtLeast("2.22.0"), // first version that supports the --rebase-merges option
1413
SetupConfig: func(config *config.AppConfig) {},
1514
SetupRepo: func(shell *Shell) {
1615
shared.CreateMergeCommit(shell)

pkg/integration/tests/interactive_rebase/edit_range_select_outside_rebase.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ var EditRangeSelectOutsideRebase = NewIntegrationTest(NewIntegrationTestArgs{
1010
Description: "Select a range of commits to edit outside of a rebase",
1111
ExtraCmdArgs: []string{},
1212
Skip: false,
13-
GitVersion: AtLeast("2.22.0"), // first version that supports the --rebase-merges option
1413
SetupConfig: func(config *config.AppConfig) {},
1514
SetupRepo: func(shell *Shell) {
1615
shared.CreateMergeCommit(shell)

pkg/integration/tests/submodule/enter.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ var Enter = NewIntegrationTest(NewIntegrationTestArgs{
2929
t.Views().Status().Content(Contains("repo"))
3030
}
3131
assertInSubmodule := func() {
32-
if t.Git().Version().IsAtLeast(2, 22, 0) {
33-
t.Views().Status().Content(Contains("my_submodule_path(my_submodule_name)"))
34-
} else {
35-
t.Views().Status().Content(Contains("my_submodule_path"))
36-
}
32+
t.Views().Status().Content(Contains("my_submodule_path(my_submodule_name)"))
3733
}
3834

3935
assertInParentRepo()

pkg/integration/tests/submodule/enter_nested.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@ var EnterNested = NewIntegrationTest(NewIntegrationTestArgs{
3737
// enter the nested submodule
3838
PressEnter()
3939

40-
if t.Git().Version().IsAtLeast(2, 22, 0) {
41-
t.Views().Status().Content(Contains("innerSubPath(innerSubName)"))
42-
} else {
43-
t.Views().Status().Content(Contains("innerSubPath"))
44-
}
40+
t.Views().Status().Content(Contains("innerSubPath(innerSubName)"))
4541
t.Views().Commits().ContainsLines(
4642
Contains("initial inner commit"),
4743
)

pkg/integration/tests/submodule/reset.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ var Reset = NewIntegrationTest(NewIntegrationTestArgs{
3131
t.Views().Status().Content(Contains("repo"))
3232
}
3333
assertInSubmodule := func() {
34-
if t.Git().Version().IsAtLeast(2, 22, 0) {
35-
t.Views().Status().Content(Contains("my_submodule_path(my_submodule_name)"))
36-
} else {
37-
t.Views().Status().Content(Contains("my_submodule_path"))
38-
}
34+
t.Views().Status().Content(Contains("my_submodule_path(my_submodule_name)"))
3935
}
4036

4137
assertInParentRepo()

0 commit comments

Comments
 (0)