(diff string)
| 2942 | } |
| 2943 | |
| 2944 | func truncateDiffForCommit(diff string) (string, bool) { |
| 2945 | runes := []rune(diff) |
| 2946 | if len(runes) <= maxCommitDiffRunes { |
| 2947 | return diff, false |
| 2948 | } |
| 2949 | |
| 2950 | trimmed := string(runes[:maxCommitDiffRunes]) |
| 2951 | return trimmed + fmt.Sprintf("\n\n[Diff truncated to the first %d characters]", maxCommitDiffRunes), true |
| 2952 | } |
| 2953 | |
| 2954 | func splitCommitMessageParagraphs(message string) []string { |
| 2955 | lines := strings.Split(message, "\n") |