From 25c0d0cf90edce3266e32ec1bfeaa2614d98c2f3 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Wed, 17 Sep 2025 12:16:04 -0600 Subject: [PATCH] Refactor comments in stripDiffFormat function Simplified and clarified comments in the stripDiffFormat function to improve readability and maintainability. No functional changes were made to the code. --- pkg/cmd/agent-task/shared/log.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/cmd/agent-task/shared/log.go b/pkg/cmd/agent-task/shared/log.go index 4959cecbd..c94f5e603 100644 --- a/pkg/cmd/agent-task/shared/log.go +++ b/pkg/cmd/agent-task/shared/log.go @@ -342,18 +342,15 @@ func stripDiffFormat(diff string) string { } } - // Guard clause: if we didn't find a hunk header, this isn't a diff, so - // we defensively just return the original string. + // This isn't a diff. if hunkEndIndex == -1 { return diff } - // We found the hunk header end; strip everything before it. + // Removing hunk header. lines = lines[hunkEndIndex+1:] - // Now we strip the leading + and - from lines, if they exist. - // Note: most of the time, but not all the time, we get a diff without - // these prefixes. + // Strip the leading + and - from lines, if they exist. var stripped []string for _, line := range lines { if strings.HasPrefix(line, "+") || strings.HasPrefix(line, "-") {