mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-21 04:46:29 +03:00
Users can copy commits from one repo to another with "git format-patch" and "git am", for example with custom commands. If "git am" stopped with a conflict, lazygit showed this as a rebase, because git am uses the rebase-apply directory too. The rebase options in the m menu didn't work either; git refuses to run "git rebase --continue" during an am. Recognize an am by the rebase-apply/applying file, and call this state "applying patches". The m menu then offers "git am --continue", "--abort" and "--skip". If "git am --continue" finds nothing to commit, it says "No changes - did you forget to use 'git add'?". Unlike for a rebase, don't skip the patch in that case. Without --3way, git am leaves the files alone if a patch doesn't apply, and skipping would lose the patch. If a lock error stops "git am --continue" or "--skip" after it has moved on to the next patch, don't run it again; this could skip that patch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.0 KiB
Go
35 lines
1.0 KiB
Go
package am
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
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"))
|
|
},
|
|
})
|