1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-29 22:48:24 +02:00

fix: fix stash with empty message

This commit is contained in:
Ryooooooga
2022-10-13 22:20:15 +09:00
parent fc0b14edef
commit a4239c7a37
4 changed files with 44 additions and 5 deletions

View File

@@ -17,6 +17,14 @@ func SplitLines(multilineString string) []string {
return lines
}
func SplitNul(str string) []string {
if str == "" {
return make([]string, 0)
}
str = strings.TrimSuffix(str, "\x00")
return strings.Split(str, "\x00")
}
// NormalizeLinefeeds - Removes all Windows and Mac style line feeds
func NormalizeLinefeeds(str string) string {
str = strings.Replace(str, "\r\n", "\n", -1)