(node *filetree.Node[models.CommitFile], depth int)
| 327 | } |
| 328 | |
| 329 | func commitFileNameAtDepth(node *filetree.Node[models.CommitFile], depth int) string { |
| 330 | splitName := split(node.GetInternalPath()) |
| 331 | if depth == 0 && splitName[0] == "." { |
| 332 | if len(splitName) == 1 { |
| 333 | return "/" |
| 334 | } |
| 335 | depth = 1 |
| 336 | } |
| 337 | name := join(splitName[depth:]) |
| 338 | |
| 339 | return name |
| 340 | } |
| 341 | |
| 342 | func split(str string) []string { |
| 343 | return strings.Split(str, "/") |
no test coverage detected