From 62ab41c310124e5df210a4a4460b356ab6d0f73b Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sat, 1 Jul 2023 17:44:14 +0200 Subject: [PATCH] Fix pull rebase tests It seems that older git versions would drop empty commits when rebasing. Since this aspect is not relevant to what we're testing here, fix this by simply avoiding empty commits in these tests. --- pkg/integration/tests/sync/pull_rebase.go | 6 ++++-- .../tests/sync/pull_rebase_interactive_conflict.go | 6 ++++-- .../tests/sync/pull_rebase_interactive_conflict_drop.go | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pkg/integration/tests/sync/pull_rebase.go b/pkg/integration/tests/sync/pull_rebase.go index 41ca82436..77810426e 100644 --- a/pkg/integration/tests/sync/pull_rebase.go +++ b/pkg/integration/tests/sync/pull_rebase.go @@ -15,14 +15,16 @@ var PullRebase = NewIntegrationTest(NewIntegrationTestArgs{ shell.Commit("one") shell.UpdateFileAndAdd("file", "content2") shell.Commit("two") - shell.EmptyCommit("three") + shell.CreateFileAndAdd("file3", "content3") + shell.Commit("three") shell.CloneIntoRemote("origin") shell.SetBranchUpstream("master", "origin/master") shell.HardReset("HEAD^^") - shell.EmptyCommit("four") + shell.CreateFileAndAdd("file4", "content4") + shell.Commit("four") shell.SetConfig("pull.rebase", "true") }, diff --git a/pkg/integration/tests/sync/pull_rebase_interactive_conflict.go b/pkg/integration/tests/sync/pull_rebase_interactive_conflict.go index 9e66f3bcd..a6a3f5356 100644 --- a/pkg/integration/tests/sync/pull_rebase_interactive_conflict.go +++ b/pkg/integration/tests/sync/pull_rebase_interactive_conflict.go @@ -15,7 +15,8 @@ var PullRebaseInteractiveConflict = NewIntegrationTest(NewIntegrationTestArgs{ shell.Commit("one") shell.UpdateFileAndAdd("file", "content2") shell.Commit("two") - shell.EmptyCommit("three") + shell.CreateFileAndAdd("file3", "content3") + shell.Commit("three") shell.CloneIntoRemote("origin") @@ -24,7 +25,8 @@ var PullRebaseInteractiveConflict = NewIntegrationTest(NewIntegrationTestArgs{ shell.HardReset("HEAD^^") shell.UpdateFileAndAdd("file", "content4") shell.Commit("four") - shell.EmptyCommit("five") + shell.CreateFileAndAdd("file5", "content5") + shell.Commit("five") shell.SetConfig("pull.rebase", "interactive") }, diff --git a/pkg/integration/tests/sync/pull_rebase_interactive_conflict_drop.go b/pkg/integration/tests/sync/pull_rebase_interactive_conflict_drop.go index 9ca3a0ebe..b53790964 100644 --- a/pkg/integration/tests/sync/pull_rebase_interactive_conflict_drop.go +++ b/pkg/integration/tests/sync/pull_rebase_interactive_conflict_drop.go @@ -15,7 +15,8 @@ var PullRebaseInteractiveConflictDrop = NewIntegrationTest(NewIntegrationTestArg shell.Commit("one") shell.UpdateFileAndAdd("file", "content2") shell.Commit("two") - shell.EmptyCommit("three") + shell.CreateFileAndAdd("file3", "content3") + shell.Commit("three") shell.CloneIntoRemote("origin") @@ -24,7 +25,8 @@ var PullRebaseInteractiveConflictDrop = NewIntegrationTest(NewIntegrationTestArg shell.HardReset("HEAD^^") shell.UpdateFileAndAdd("file", "content4") shell.Commit("four") - shell.EmptyCommit("five") + shell.CreateFileAndAdd("fil5", "content5") + shell.Commit("five") shell.SetConfig("pull.rebase", "interactive") },