MCPcopy
hub / github.com/sqlc-dev/sqlc / filterHunks

Function filterHunks

internal/cmd/cmd.go:249–266  ·  view source on GitHub ↗
(uniHunks []gonp.UniHunk[T])

Source from the content-addressed store, hash-verified

247}
248
249func filterHunks[T gonp.Elem](uniHunks []gonp.UniHunk[T]) []gonp.UniHunk[T] {
250 var out []gonp.UniHunk[T]
251 for i, uniHunk := range uniHunks {
252 var changed bool
253 for _, e := range uniHunk.GetChanges() {
254 switch e.GetType() {
255 case gonp.SesDelete:
256 changed = true
257 case gonp.SesAdd:
258 changed = true
259 }
260 }
261 if changed {
262 out = append(out, uniHunks[i])
263 }
264 }
265 return out
266}
267
268var diffCmd = &cobra.Command{
269 Use: "diff",

Callers 1

DiffFunction · 0.85

Calls 2

GetChangesMethod · 0.80
GetTypeMethod · 0.45

Tested by

no test coverage detected