MCPcopy
hub / github.com/go-git/go-git / AddOp

Method AddOp

plumbing/format/diff/unified_encoder.go:362–377  ·  view source on GitHub ↗
(t Operation, ss ...string)

Source from the content-addressed store, hash-verified

360}
361
362func (h *hunk) AddOp(t Operation, ss ...string) {
363 n := len(ss)
364 switch t {
365 case Add:
366 h.toCount += n
367 case Delete:
368 h.fromCount += n
369 case Equal:
370 h.toCount += n
371 h.fromCount += n
372 }
373
374 for _, s := range ss {
375 h.ops = append(h.ops, &op{s, t})
376 }
377}
378
379type op struct {
380 text string

Callers 3

GenerateMethod · 0.80
processHunkMethod · 0.80
processEqualsLinesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected