commands/path.go: add documentation to trimCurrentPrefix

This commit is contained in:
Taylor Blau 2018-04-05 12:17:37 -07:00
parent 2dd4cf29d0
commit 712769b37c

@ -17,6 +17,12 @@ const (
nixPrefix = `./`
)
// trimCurrentPrefix removes a leading prefix of "./" or ".\" (referring to the
// current directory in a platform independent manner).
//
// It is useful for callers such as "git lfs track" and "git lfs untrack", that
// wish to compare filepaths and/or attributes patterns without cleaning across
// multiple platforms.
func trimCurrentPrefix(p string) string {
if strings.HasPrefix(p, windowsPrefix) {
return strings.TrimPrefix(p, windowsPrefix)