aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-03-21 02:49:02 +0000
committerGitHub <noreply@github.com>2020-03-21 10:49:02 +0800
commit6ee67312909d2ccfa47496d50bf46e0665902b2d (patch)
treeb19c483e84675dd0370b2d5ab0761688686a76e6
parent602fe459364fe1da01471a1c766127ec25b77b38 (diff)
downloadgitea-6ee67312909d2ccfa47496d50bf46e0665902b2d.tar.gz
gitea-6ee67312909d2ccfa47496d50bf46e0665902b2d.zip
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>
-rw-r--r--models/error.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/error.go b/models/error.go
index f1d2404441..79322c5d7d 100644
--- a/models/error.go
+++ b/models/error.go
@@ -1407,7 +1407,7 @@ func (err *ErrPushRejected) GenerateMessage() {
}
i += 8
nl := strings.IndexByte(err.StdErr[i:], '\n')
- if nl > 0 {
+ if nl >= 0 {
messageBuilder.WriteString(err.StdErr[i : i+nl+1])
i = i + nl + 1
} else {