Content-Length: 268717 | pFad | http://github.com/github/github-mcp-server/commit/721fd3e3c8a745d4b6147749dc606a05ebf9dbfc

C4 Add comment to trim lines (#621) · github/github-mcp-server@721fd3e · GitHub
Skip to content

Commit 721fd3e

Browse files
authored
Add comment to trim lines (#621)
1 parent b44dee6 commit 721fd3e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/github/actions.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,10 +799,11 @@ func trimContent(content string, tailLines int) (string, int) {
799799
lineCount := 0
800800
if tailLines > 0 {
801801

802-
// Count backwards to find the nth newline from the end
802+
// Count backwards to find the nth newline from the end and a total number of lines
803803
for i := len(content) - 1; i >= 0 && lineCount < tailLines; i-- {
804804
if content[i] == '\n' {
805805
lineCount++
806+
// If we have reached the tailLines, trim the content
806807
if lineCount == tailLines {
807808
content = content[i+1:]
808809
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/github/github-mcp-server/commit/721fd3e3c8a745d4b6147749dc606a05ebf9dbfc

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy