mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-23 22:24:51 +02:00
Extract a InternalTreePathForFilePath helper function
This commit is contained in:
@@ -162,9 +162,13 @@ func join(strs []string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func SplitFileTreePath(path string, showRootItem bool) []string {
|
func SplitFileTreePath(path string, showRootItem bool) []string {
|
||||||
|
return split(InternalTreePathForFilePath(path, showRootItem))
|
||||||
|
}
|
||||||
|
|
||||||
|
func InternalTreePathForFilePath(path string, showRootItem bool) string {
|
||||||
if showRootItem {
|
if showRootItem {
|
||||||
return split("./" + path)
|
return "./" + path
|
||||||
}
|
}
|
||||||
|
|
||||||
return split(path)
|
return path
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user