1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-25 10:04:27 +00:00

account for empty lines in receive-hook message (#10773) (#10784)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
zeripath 2020-03-21 02:49:02 +00:00 committed by GitHub
parent 602fe45936
commit 6ee6731290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1407,7 +1407,7 @@ func (err *ErrPushRejected) GenerateMessage() {
} }
i += 8 i += 8
nl := strings.IndexByte(err.StdErr[i:], '\n') nl := strings.IndexByte(err.StdErr[i:], '\n')
if nl > 0 { if nl >= 0 {
messageBuilder.WriteString(err.StdErr[i : i+nl+1]) messageBuilder.WriteString(err.StdErr[i : i+nl+1])
i = i + nl + 1 i = i + nl + 1
} else { } else {