MCPcopy
hub / github.com/harness/harness / scanHunkHeader

Function scanHunkHeader

git/parser/diff_cut.go:191–204  ·  view source on GitHub ↗

scanHunkHeader keeps reading lines until hunk header line is read.

(scan *bufio.Scanner)

Source from the content-addressed store, hash-verified

189
190// scanHunkHeader keeps reading lines until hunk header line is read.
191func scanHunkHeader(scan *bufio.Scanner) (HunkHeader, error) {
192 for scan.Scan() {
193 line := scan.Text()
194 if h, ok := ParseDiffHunkHeader(line); ok {
195 return h, nil
196 }
197 }
198
199 if err := scan.Err(); err != nil {
200 return HunkHeader{}, err
201 }
202
203 return HunkHeader{}, ErrHunkNotFound
204}
205
206type diffAction byte
207

Callers 1

DiffCutFunction · 0.85

Calls 4

ParseDiffHunkHeaderFunction · 0.85
ScanMethod · 0.65
TextMethod · 0.65
ErrMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…