Skip to content

Commit

Permalink
Fix SHA crash
Browse files Browse the repository at this point in the history
  • Loading branch information
russss committed Nov 14, 2018
1 parent 5673c42 commit 310f8f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion httplistener/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ func refType(ref string) string {
}

func truncateSha(sha string) string {
if len(sha) < 8 {
return ""
}
return sha[len(sha)-7:]
}

Expand Down Expand Up @@ -99,7 +102,7 @@ func commitLimit(pl github.PushPayload, length int) []Commit {
if !c.Distinct {
continue
}
res = append(res, Commit{Message: c.Message, Username: c.Author.Username, Sha: c.Sha})
res = append(res, Commit{Message: c.Message, Username: c.Author.Username, Sha: c.ID})
i += 1
if i == length {
break
Expand Down

0 comments on commit 310f8f9

Please sign in to comment.