am

package
v0.66.4 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 3 Imported by: ? modules, 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 AbortAfterConflictWhenContinuing = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Continue applying patches with git am, and abort when the next patch conflicts too",
	ExtraCmdArgs: []string{},
	Skip:         false,
	SetupConfig:  func(config *config.AppConfig) {},
	SetupRepo: func(shell *Shell) {
		setUpConflictingAm(shell, true, true)
	},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.Shell().UpdateFileAndAdd("file", "resolved\n")

		t.GlobalPress(keys.Universal.CreateRebaseOptionsMenu)
		t.ExpectPopup().Menu().
			Title(Equals("Applying patches")).
			Select(Contains("continue")).
			Confirm()

		t.ExpectPopup().Menu().
			Title(Equals("Conflicts!")).
			Select(Contains("Abort applying patches")).
			Confirm()

		t.Views().Status().Content(Equals("repo → master"))

		t.Views().Commits().
			Lines(
				Contains("conflicting change"),
				Contains("base"),
			)
	},
})
View Source
var ContinueAfterResolvingConflicts = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Continue applying patches with git am after resolving the conflicts of one of them",
	ExtraCmdArgs: []string{},
	Skip:         false,
	SetupConfig:  func(config *config.AppConfig) {},
	SetupRepo: func(shell *Shell) {
		setUpConflictingAm(shell, false, true)
	},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.Views().Status().Content(Equals("(applying patches) repo → master"))
		t.Views().Information().Content(Contains("Applying patches"))
		t.Views().Options().Content(Contains("View 'am' options: m"))

		t.Views().Files().
			IsFocused().
			Lines(
				Contains("UU").Contains("file"),
			)

		t.Views().Commits().
			Focus().
			Lines(
				Contains("─── Pending patches"),
				Contains("pick").Contains("add file2"),
				Contains("pick").Contains("<-- CONFLICT --- change file").IsSelected(),
				Contains("─── Commits"),
				Contains("conflicting change"),
				Contains("base"),
			).
			NavigateToLine(Contains("add file2")).
			Tap(func() {
				t.Views().Main().Content(
					Contains("Subject: [PATCH 2/2] add file2").
						Contains("+two"))
			}).
			Press(keys.Universal.Remove).
			Tap(func() {
				t.ExpectToast(Equals("Disabled: This action is not allowed while applying patches"))
			})

		t.Shell().UpdateFileAndAdd("file", "resolved\n")

		t.GlobalPress(keys.Universal.CreateRebaseOptionsMenu)
		t.ExpectPopup().Menu().
			Title(Equals("Applying patches")).
			Lines(
				Contains("continue"),
				Contains("abort"),
				Contains("skip"),
				Contains("Cancel"),
			).
			Select(Contains("continue")).
			Confirm()

		t.Views().Status().Content(Equals("repo → master"))

		t.Views().Commits().
			Lines(
				Contains("add file2"),
				Contains("change file"),
				Contains("conflicting change"),
				Contains("base"),
			)
	},
})
View Source
var ContinueWithoutResolving = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Continue applying patches with git am after a patch didn't apply, without doing anything about it",
	ExtraCmdArgs: []string{},
	Skip:         false,
	SetupConfig:  func(config *config.AppConfig) {},
	SetupRepo: func(shell *Shell) {
		setUpConflictingAm(shell, false, false)
	},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.Views().Status().Content(Equals("(applying patches) repo → master"))

		t.Views().Files().IsEmpty()

		t.GlobalPress(keys.Universal.CreateRebaseOptionsMenu)
		t.ExpectPopup().Menu().
			Title(Equals("Applying patches")).
			Select(Contains("continue")).
			Confirm()

		t.ExpectPopup().Alert().
			Title(Equals("Error")).
			Content(Contains("No changes - did you forget to use 'git add'?")).
			Confirm()

		t.Views().Status().Content(Equals("(applying patches) repo → master"))
	},
})
View Source
var LockErrorPartwayThroughSkip = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Skip a conflicting patch while another git process takes index.lock before git am applies the patch after the next one",
	ExtraCmdArgs: []string{},
	Skip:         false,
	SetupConfig:  func(config *config.AppConfig) {},
	SetupRepo: func(shell *Shell) {
		shell.
			CreateFileAndAdd("file", "original\n").
			Commit("base").
			NewBranch("source").
			UpdateFileAndAdd("file", "source\n").
			Commit("change file").
			CreateFileAndAdd("file2", "two\n").
			Commit("add file2").
			CreateFileAndAdd("file3", "three\n").
			Commit("add file3").
			RunShellCommand("git format-patch --stdout master..source > ../patches.mbox").
			Checkout("master").
			UpdateFileAndAdd("file", "master\n").
			Commit("conflicting change").
			RunCommandExpectError([]string{"git", "am", "--3way", "../patches.mbox"})

		shared.HoldIndexLockAfterNextAppliedPatch(shell)
	},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.GlobalPress(keys.Universal.CreateRebaseOptionsMenu)
		t.ExpectPopup().Menu().
			Title(Equals("Applying patches")).
			Select(Contains("skip")).
			Confirm()

		t.ExpectPopup().Alert().
			Title(Equals("Error")).
			Content(Contains("index.lock': File exists.")).
			Confirm()

		t.Views().Status().Content(Equals("(applying patches) repo → master"))
	},
})
View Source
var SkipConflictingPatch = NewIntegrationTest(NewIntegrationTestArgs{
	Description:  "Skip a patch that conflicts while applying patches with git am",
	ExtraCmdArgs: []string{},
	Skip:         false,
	SetupConfig:  func(config *config.AppConfig) {},
	SetupRepo: func(shell *Shell) {
		setUpConflictingAm(shell, false, true)
	},
	Run: func(t *TestDriver, keys config.KeybindingConfig) {
		t.Views().Status().Content(Equals("(applying patches) repo → master"))

		t.GlobalPress(keys.Universal.CreateRebaseOptionsMenu)
		t.ExpectPopup().Menu().
			Title(Equals("Applying patches")).
			Select(Contains("skip")).
			Confirm()

		t.Views().Status().Content(Equals("repo → master"))

		t.Views().Commits().
			Lines(
				Contains("add file2"),
				Contains("conflicting change"),
				Contains("base"),
			)
	},
})

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