2017-02-03 23:31:06 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import "strings"
|
|
|
|
|
|
|
|
func gitLineEnding(git env) string {
|
|
|
|
value, _ := git.Get("core.autocrlf")
|
|
|
|
switch strings.ToLower(value) {
|
|
|
|
case "input", "true", "t", "1":
|
2017-02-04 00:18:42 +00:00
|
|
|
return "\r\n"
|
2017-02-03 23:31:06 +00:00
|
|
|
default:
|
2017-02-04 00:50:47 +00:00
|
|
|
return osLineEnding()
|
2017-02-03 23:31:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
type env interface {
|
|
|
|
Get(string) (string, bool)
|
|
|
|
}
|