mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-10 20:05:50 +02:00
Check for conflicts after reverting a commit
This way we get the usual menu for viewing the conflicts or aborting, like for rebases.
This commit is contained in:
parent
4b3262ab3e
commit
3e5024480d
3 changed files with 8 additions and 7 deletions
|
@ -138,6 +138,8 @@ var conflictStrings = []string{
|
|||
"fix conflicts",
|
||||
"Resolve all conflicts manually",
|
||||
"Merge conflict in file",
|
||||
"hint: after resolving the conflicts",
|
||||
"CONFLICT (content):",
|
||||
}
|
||||
|
||||
func isMergeConflictErr(errStr string) bool {
|
||||
|
|
|
@ -868,7 +868,8 @@ func (self *LocalCommitsController) revert(commit *models.Commit) error {
|
|||
HandleConfirm: func() error {
|
||||
self.c.LogAction(self.c.Tr.Actions.RevertCommit)
|
||||
return self.c.WithWaitingStatusSync(self.c.Tr.RevertingStatus, func() error {
|
||||
if err := self.c.Git().Commit.Revert(commit.Hash); err != nil {
|
||||
result := self.c.Git().Commit.Revert(commit.Hash)
|
||||
if err := self.c.Helpers().MergeAndRebase.CheckMergeOrRebase(result); err != nil {
|
||||
return err
|
||||
}
|
||||
return self.afterRevertCommit()
|
||||
|
|
|
@ -33,11 +33,9 @@ var RevertWithConflictSingleCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
|||
Title(Equals("Revert commit")).
|
||||
Content(MatchesRegexp(`Are you sure you want to revert \w+?`)).
|
||||
Confirm()
|
||||
t.ExpectPopup().Alert().
|
||||
Title(Equals("Error")).
|
||||
// The exact error message is different on different git versions,
|
||||
// but they all contain the word 'conflict' somewhere.
|
||||
Content(Contains("conflict")).
|
||||
t.ExpectPopup().Menu().
|
||||
Title(Equals("Conflicts!")).
|
||||
Select(Contains("View conflicts")).
|
||||
Confirm()
|
||||
}).
|
||||
Lines(
|
||||
|
@ -56,7 +54,7 @@ var RevertWithConflictSingleCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
|||
t.Views().Options().Content(Contains("View revert options: m"))
|
||||
t.Views().Information().Content(Contains("Reverting (Reset)"))
|
||||
|
||||
t.Views().Files().Focus().
|
||||
t.Views().Files().IsFocused().
|
||||
Lines(
|
||||
Contains("UU myfile").IsSelected(),
|
||||
).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue