trimTreePrefix removes up to n leading directory components from name.
(name string, n int)
| 503 | |
| 504 | // trimTreePrefix removes up to n leading directory components from name. |
| 505 | func trimTreePrefix(name string, n int) string { |
| 506 | i := 0 |
| 507 | for ; i < len(name) && n > 0; i++ { |
| 508 | if name[i] == '/' { |
| 509 | n-- |
| 510 | } |
| 511 | } |
| 512 | return name[i:] |
| 513 | } |
| 514 | |
| 515 | // hasEpochTimestamp returns true if the string ends with a POSIX-formatted |
| 516 | // timestamp for the UNIX epoch after a tab character. According to git, this |
no outgoing calls
no test coverage detected