mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
Fix pick all hunks
This commit is contained in:
committed by
Jesse Duffield
parent
a533f8e1a5
commit
6ca42ff720
@ -22,7 +22,7 @@ const (
|
||||
TOP Selection = iota
|
||||
MIDDLE
|
||||
BOTTOM
|
||||
BOTH
|
||||
ALL
|
||||
)
|
||||
|
||||
// mergeConflict : A git conflict with a start, ancestor (if exists), target, and end corresponding to line
|
||||
@ -179,6 +179,12 @@ func isIndexToDelete(i int, conflict *mergeConflict, selection Selection) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
isMarkerLine :=
|
||||
i == conflict.start ||
|
||||
i == conflict.ancestor ||
|
||||
i == conflict.target ||
|
||||
i == conflict.end
|
||||
|
||||
var isWantedContent bool
|
||||
switch selection {
|
||||
case TOP:
|
||||
@ -191,7 +197,9 @@ func isIndexToDelete(i int, conflict *mergeConflict, selection Selection) bool {
|
||||
isWantedContent = conflict.ancestor < i && i < conflict.target
|
||||
case BOTTOM:
|
||||
isWantedContent = conflict.target < i && i < conflict.end
|
||||
case ALL:
|
||||
isWantedContent = true
|
||||
}
|
||||
|
||||
return !isWantedContent
|
||||
return isMarkerLine || !isWantedContent
|
||||
}
|
||||
|
Reference in New Issue
Block a user