Skip to content

Commit

Permalink
Fix panic on signed empty commit message (go-gitea/gitea#6292)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeripath committed Mar 9, 2019
1 parent 6cba05a commit 57fb34c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion repo_commit.go
Expand Up @@ -101,7 +101,11 @@ l:
sig, err := newGPGSignatureFromCommitline(data, (nextline+1)+sigindex, true)
if err == nil && sig != nil {
// remove signature from commit message
cm = cm[:sigindex-1]
if sigindex == 0 {
cm = cm[:0]
} else {
cm = cm[:sigindex-1]
}
commit.Signature = sig
}
}
Expand Down

0 comments on commit 57fb34c

Please sign in to comment.