Skip to content

Commit

Permalink
Support for newlines in Windows (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
seachicken authored May 20, 2022
1 parent 5749abb commit 874be64
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion poi.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,8 @@ func branchNameExists(branchName string, branches []Branch) bool {
}

func splitLines(text string) []string {
return strings.FieldsFunc(text, func(c rune) bool { return c == '\n' })
return strings.FieldsFunc(strings.Replace(text, "\r\n", "\n", -1),
func(c rune) bool { return c == '\n' })
}

func (b Branch) IsDetached() bool {
Expand Down

0 comments on commit 874be64

Please sign in to comment.