| 1 | package commands |
| 2 | |
| 3 | import "strings" |
| 4 | |
| 5 | func gitLineEnding(git env) string { |
| 6 | value, _ := git.Get("core.autocrlf") |
| 7 | switch strings.ToLower(value) { |
| 8 | case "true", "t", "1": |
| 9 | return "\r\n" |
| 10 | default: |
| 11 | return osLineEnding() |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | type env interface { |
| 16 | Get(string) (string, bool) |
| 17 | } |