MCPcopy Create free account
hub / github.com/go-git/go-git / validChange

Method validChange

worktree.go:491–507  ·  view source on GitHub ↗
(ch merkletrie.Change)

Source from the content-addressed store, hash-verified

489}
490
491func (w *Worktree) validChange(ch merkletrie.Change) error {
492 action, err := ch.Action()
493 if err != nil {
494 return nil
495 }
496
497 switch action {
498 case merkletrie.Delete:
499 return validPath(ch.From.String())
500 case merkletrie.Insert:
501 return validPath(ch.To.String())
502 case merkletrie.Modify:
503 return validPath(ch.From.String(), ch.To.String())
504 }
505
506 return nil
507}
508
509func (w *Worktree) checkoutChange(ch merkletrie.Change, t *object.Tree, idx *indexBuilder) error {
510 a, err := ch.Action()

Callers 1

resetWorktreeMethod · 0.95

Calls 3

validPathFunction · 0.85
StringMethod · 0.65
ActionMethod · 0.45

Tested by

no test coverage detected