MCPcopy
hub / github.com/git-lfs/git-lfs / TrimCurrentPrefix

Function TrimCurrentPrefix

tools/filetools.go:523–528  ·  view source on GitHub ↗

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 platfo

(p string)

Source from the content-addressed store, hash-verified

521// wish to compare filepaths and/or attributes patterns without cleaning across
522// multiple platforms.
523func TrimCurrentPrefix(p string) string {
524 if strings.HasPrefix(p, windowsPrefix) {
525 return strings.TrimPrefix(p, windowsPrefix)
526 }
527 return strings.TrimPrefix(p, nixPrefix)
528}

Callers 3

removePathFunction · 0.92
trackCommandFunction · 0.92
AttrPathsFromReaderFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected