MCPcopy Index your code
hub / github.com/nikivdev/go / truncateDiffForCommit

Function truncateDiffForCommit

cli/flow/main.go:2944–2952  ·  view source on GitHub ↗
(diff string)

Source from the content-addressed store, hash-verified

2942}
2943
2944func 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
2954func splitCommitMessageParagraphs(message string) []string {
2955 lines := strings.Split(message, "\n")

Callers 1

prepareCommitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected