-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create fixup commit at end of its branch when there's a stack of bran…
…ches
- Loading branch information
1 parent
396215a
commit b22149d
Showing
4 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
pkg/integration/tests/commit/create_fixup_commit_in_branch_stack.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package commit | ||
|
||
import ( | ||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
) | ||
|
||
var CreateFixupCommitInBranchStack = NewIntegrationTest(NewIntegrationTestArgs{ | ||
Description: "Create a fixup commit in a stack of branches, verify that it is created at the end of the branch it belongs to", | ||
ExtraCmdArgs: []string{}, | ||
Skip: false, | ||
GitVersion: AtLeast("2.38.0"), | ||
SetupConfig: func(config *config.AppConfig) {}, | ||
SetupRepo: func(shell *Shell) { | ||
shell.NewBranch("branch1") | ||
shell.EmptyCommit("branch1 commit 1") | ||
shell.EmptyCommit("branch1 commit 2") | ||
shell.EmptyCommit("branch1 commit 3") | ||
shell.NewBranch("branch2") | ||
shell.EmptyCommit("branch2 commit 1") | ||
shell.EmptyCommit("branch2 commit 2") | ||
shell.CreateFileAndAdd("fixup-file", "fixup content") | ||
|
||
shell.SetConfig("rebase.updateRefs", "true") | ||
}, | ||
Run: func(t *TestDriver, keys config.KeybindingConfig) { | ||
t.Views().Commits(). | ||
Focus(). | ||
Lines( | ||
Contains("CI ◯ branch2 commit 2"), | ||
Contains("CI ◯ branch2 commit 1"), | ||
Contains("CI ◯ * branch1 commit 3"), | ||
Contains("CI ◯ branch1 commit 2"), | ||
Contains("CI ◯ branch1 commit 1"), | ||
). | ||
NavigateToLine(Contains("branch1 commit 2")). | ||
Press(keys.Commits.CreateFixupCommit). | ||
Tap(func() { | ||
t.ExpectPopup().Menu(). | ||
Title(Equals("Create fixup commit")). | ||
Select(Contains("fixup! commit")). | ||
Confirm() | ||
}). | ||
Lines( | ||
Contains("CI ◯ branch2 commit 2"), | ||
Contains("CI ◯ branch2 commit 1"), | ||
Contains("CI ◯ * fixup! branch1 commit 2"), | ||
Contains("CI ◯ branch1 commit 3"), | ||
Contains("CI ◯ branch1 commit 2"), | ||
Contains("CI ◯ branch1 commit 1"), | ||
) | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters