1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

prevent staging directory containing files with inline merge conflicts

This commit is contained in:
Jesse Duffield
2021-03-21 15:44:10 +11:00
parent e3ddfbf2b8
commit 9e67f74ca3
3 changed files with 26 additions and 16 deletions

View File

@ -225,8 +225,6 @@ func (gui *Gui) handleFilePress() error {
return nil
}
// need to stage or unstage depending on situation. If we have a merge conflict we can't do anything
if node.IsLeaf() {
file := node.File
@ -244,6 +242,12 @@ func (gui *Gui) handleFilePress() error {
}
}
} else {
// if any files within have inline merge conflicts we can't stage or unstage,
// or it'll end up with those >>>>>> lines actually staged
if node.GetHasInlineMergeConflicts() {
return gui.createErrorPanel(gui.Tr.ErrStageDirWithInlineMergeConflicts)
}
if node.GetHasUnstagedChanges() {
if err := gui.GitCommand.StageFile(node.Path); err != nil {
return gui.surfaceError(err)