Commit Graph

5 Commits

Author SHA1 Message Date
Taylor Blau
712769b37c commands/path.go: add documentation to trimCurrentPrefix 2018-04-05 12:17:37 -07:00
Taylor Blau
1c8209bacf commands/path.go: introduce trimCurrentPrefix to remove "./"
There exist cases within Git LFS where we would like to perform a
"pseudo-clean" on a given filepath. It should behave similarly to a call
to filepath.Clean, but should only remove the beginning "./" (macOS,
*nix) or ".\" (Windows, etc).

This patch introduces trimCurrentPrefix, which removes such prefixes.
It will be used in subsequent patches to perform prefix-independent
comparison against arguments to "git lfs track" and "git lfs untrack"
and the contents of a repository's .gitattributes file.

Since we assume that the contents of ".gitattributes" are written on
multiple platforms, each with their own platform-specific prefixes,
trimCurrentPrefix is instructed to remove _all_ prefixes, not just the
current platforms.
2018-04-05 10:46:12 -07:00
risk danger olson
468984df50 commands: osLineEnding() is more descriptive 2017-02-03 17:50:47 -07:00
risk danger olson
0345e44bb8 commands: unnecessary const 2017-02-03 17:18:42 -07:00
risk danger olson
8c0043f54d commands: look at autocrlf for the line ending 2017-02-03 16:31:06 -07:00