Permalink
Browse files

releaser: Git info bounds checking

  • Loading branch information...
bep committed Jan 11, 2018
1 parent 50fb49c commit f82428d2e0c5078c11d1b296f7ebc8cfb6216860
Showing with 15 additions and 6 deletions.
  1. +15 −6 releaser/git.go
View
@@ -227,13 +227,22 @@ func getGitInfosBefore(ref, tag, repo, repoPath string, remote bool) (gitInfos,
for _, entry := range entries {
items := strings.Split(entry, "\x1f")
gi := gitInfo{
Hash: items[0],
Author: items[1],
Subject: items[2],
Body: items[3],
gi := gitInfo{}
if len(items) > 0 {
gi.Hash = items[0]
}
if len(items) > 1 {
gi.Author = items[1]
}
if len(items) > 2 {
gi.Subject = items[2]
}
if remote {
if len(items) > 3 {
gi.Body = items[3]
}
if remote && gi.Hash != "" {
gc, err := client.fetchCommit(gi.Hash)
if err == nil {
gi.GitHubCommit = &gc

0 comments on commit f82428d

Please sign in to comment.