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

Method DeleteObject

prune.go:24–31  ·  view source on GitHub ↗

DeleteObject deletes an object from a repository. The type conveniently matches PruneHandler.

(hash plumbing.Hash)

Source from the content-addressed store, hash-verified

22// DeleteObject deletes an object from a repository.
23// The type conveniently matches PruneHandler.
24func (r *Repository) DeleteObject(hash plumbing.Hash) error {
25 los, ok := r.Storer.(storer.LooseObjectStorer)
26 if !ok {
27 return ErrLooseObjectsNotSupported
28 }
29
30 return los.DeleteLooseObject(hash)
31}
32
33func (r *Repository) Prune(opt PruneOptions) error {
34 los, ok := r.Storer.(storer.LooseObjectStorer)

Callers

nothing calls this directly

Calls 1

DeleteLooseObjectMethod · 0.65

Tested by

no test coverage detected