note = bytes.TrimRight(note, "\r\n")
// Remove trailing whitespaces, because git-notes-add will remove
- // them anyway, and we have to know exact bytes count
+ // them anyway, and we have to know exact bytes count. Also convert
+ // all tabs into spaces
lines := strings.Split(string(body), "\n")
for i, line := range lines {
- lines[i] = strings.TrimRight(line, " \r")
+ line = strings.ReplaceAll(line, " ", " ")
+ line = strings.TrimRight(line, " \r")
+ lines[i] = line
}
for lines[len(lines)-1] == "" {
lines = lines[:len(lines)-1]