MCPcopy Create free account
hub / github.com/alibaba/open-code-review / Hunk

Struct Hunk

internal/diff/hunk.go:25–31  ·  view source on GitHub ↗

Hunk represents one @@ ... @@ block in a unified diff.

Source from the content-addressed store, hash-verified

23
24// Hunk represents one @@ ... @@ block in a unified diff.
25type Hunk struct {
26 OldStart int // starting line in the old file (1-indexed)
27 OldCount int // number of lines in the old file
28 NewStart int // starting line in the new file (1-indexed)
29 NewCount int // number of lines in the new file
30 Lines []HunkLine // all lines in sequence
31}
32
33var hunkHeaderRe = regexp.MustCompile(`^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@`)
34

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected