1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Fix multi selection stage/discard not working for files with substrings

This commit is contained in:
Brandon
2024-05-25 15:47:15 -07:00
committed by Jesse Duffield
parent 94cf2cc7df
commit a5eec48b4b

View File

@ -1009,10 +1009,14 @@ func normalisedSelectedNodes(selectedNodes []*filetree.FileNode) []*filetree.Fil
func isDescendentOfSelectedNodes(node *filetree.FileNode, selectedNodes []*filetree.FileNode) bool {
for _, selectedNode := range selectedNodes {
if selectedNode.IsFile() {
continue
}
selectedNodePath := selectedNode.GetPath()
nodePath := node.GetPath()
if strings.HasPrefix(nodePath, selectedNodePath) && nodePath != selectedNodePath {
if strings.HasPrefix(nodePath, selectedNodePath+"/") {
return true
}
}