interactive_rebase

package
v0.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AmendMerge = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Amends a staged file to a merge commit.",
	ExtraCmdArgs: "",
	Skip:         false,
	SetupConfig:  func(config *config.AppConfig) {},
	SetupRepo: func(shell *Shell) {
		shell.
			NewBranch("development-branch").
			CreateFileAndAdd("initial-file", "initial file content").
			Commit("initial commit").
			NewBranch("feature-branch").
			CreateFileAndAdd("new-feature-file", "new content").
			Commit("new feature commit").
			Checkout("development-branch").
			Merge("feature-branch").
			CreateFileAndAdd(postMergeFilename, postMergeFileContent)
	},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		mergeCommitMessage := "Merge branch 'feature-branch' into development-branch"

		t.Views().Commits().
			Lines(
				Contains(mergeCommitMessage),
				Contains("new feature commit"),
				Contains("initial commit"),
			)

		t.Views().Commits().
			Focus().
			Press(keys.Commits.AmendToCommit)

		t.ExpectPopup().Confirmation().
			Title(Equals("Amend Commit")).
			Content(Contains("Are you sure you want to amend this commit with your staged files?")).
			Confirm()

		t.Views().Commits().
			Lines(
				Contains(mergeCommitMessage),
				Contains("new feature commit"),
				Contains("initial commit"),
			)

		t.Views().Main().
			Content(Contains(postMergeFilename)).
			Content(Contains("++" + postMergeFileContent))
	},
})
View Source
var One = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Begins an interactive rebase, then fixups, drops, and squashes some commits",
	ExtraCmdArgs: "",
	Skip:         false,
	SetupConfig:  func(config *config.AppConfig) {},
	SetupRepo: func(shell *Shell) {
		shell.
			CreateNCommits(5)
	},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.Views().Commits().
			Focus().
			Lines(
				Contains("commit 05"),
				Contains("commit 04"),
				Contains("commit 03"),
				Contains("commit 02"),
				Contains("commit 01"),
			).
			NavigateToListItem(Contains("commit 02")).
			Press(keys.Universal.Edit).
			Lines(
				MatchesRegexp("pick.*commit 05"),
				MatchesRegexp("pick.*commit 04"),
				MatchesRegexp("pick.*commit 03"),
				MatchesRegexp("YOU ARE HERE.*commit 02").IsSelected(),
				Contains("commit 01"),
			).
			SelectPreviousItem().
			Press(keys.Commits.MarkCommitAsFixup).
			Lines(
				MatchesRegexp("pick.*commit 05"),
				MatchesRegexp("pick.*commit 04"),
				MatchesRegexp("fixup.*commit 03").IsSelected(),
				MatchesRegexp("YOU ARE HERE.*commit 02"),
				Contains("commit 01"),
			).
			SelectPreviousItem().
			Press(keys.Universal.Remove).
			Lines(
				MatchesRegexp("pick.*commit 05"),
				MatchesRegexp("drop.*commit 04").IsSelected(),
				MatchesRegexp("fixup.*commit 03"),
				MatchesRegexp("YOU ARE HERE.*commit 02"),
				Contains("commit 01"),
			).
			SelectPreviousItem().
			Press(keys.Commits.SquashDown).
			Lines(
				MatchesRegexp("squash.*commit 05").IsSelected(),
				MatchesRegexp("drop.*commit 04"),
				MatchesRegexp("fixup.*commit 03"),
				MatchesRegexp("YOU ARE HERE.*commit 02"),
				Contains("commit 01"),
			).
			Tap(func() {
				t.Actions().ContinueRebase()
			}).
			Lines(
				Contains("commit 02"),
				Contains("commit 01"),
			)
	},
})

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL