git-lfs/commands/path.go
brian m. carlson 4049292152
Move trimCurrentPrefix to tools
Right now, we have a function which can trim the relative path prefix,
but that is only available in the `commands` package.  In the future,
we'll want to use it elsewhere as well, so let's move it somewhere more
accessible.
2023-03-20 19:37:24 +00:00

18 lines
275 B
Go

package commands
import "strings"
func gitLineEnding(git env) string {
value, _ := git.Get("core.autocrlf")
switch strings.ToLower(value) {
case "true", "t", "1":
return "\r\n"
default:
return osLineEnding()
}
}
type env interface {
Get(string) (string, bool)
}