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

Method Reset

worktree.go:370–372  ·  view source on GitHub ↗

Reset the worktree to a specified state.

(opts *ResetOptions)

Source from the content-addressed store, hash-verified

368
369// Reset the worktree to a specified state.
370func (w *Worktree) Reset(opts *ResetOptions) error {
371 return w.ResetSparsely(opts, nil)
372}
373
374func (w *Worktree) resetIndex(t *object.Tree, dirs []string, files []string) ([]string, error) {
375 idx, err := w.r.Storer.Index()

Callers 13

PullContextMethod · 0.95
CheckoutMethod · 0.95
RestoreMethod · 0.95
TestResetMethod · 0.95
TestResetSoftMethod · 0.95
TestResetMixedMethod · 0.95
TestResetMergeMethod · 0.95
TestResetHardMethod · 0.95
cloneMethod · 0.45

Calls 1

ResetSparselyMethod · 0.95

Tested by 9

TestResetMethod · 0.76
TestResetSoftMethod · 0.76
TestResetMixedMethod · 0.76
TestResetMergeMethod · 0.76
TestResetHardMethod · 0.76