MCPcopy Index your code
hub / github.com/go-git/go-git / DecodeObject

Function DecodeObject

plumbing/object/object.go:62–75  ·  view source on GitHub ↗

DecodeObject decodes an encoded object into an Object and associates it to the given object storer.

(s storer.EncodedObjectStorer, o plumbing.EncodedObject)

Source from the content-addressed store, hash-verified

60// DecodeObject decodes an encoded object into an Object and associates it to
61// the given object storer.
62func DecodeObject(s storer.EncodedObjectStorer, o plumbing.EncodedObject) (Object, error) {
63 switch o.Type() {
64 case plumbing.CommitObject:
65 return DecodeCommit(s, o)
66 case plumbing.TreeObject:
67 return DecodeTree(s, o)
68 case plumbing.BlobObject:
69 return DecodeBlob(o)
70 case plumbing.TagObject:
71 return DecodeTag(s, o)
72 default:
73 return nil, plumbing.ErrInvalidType
74 }
75}
76
77// DateFormat is the format being used in the original git implementation
78const DateFormat = "Mon Jan 02 15:04:05 2006 -0700"

Callers 5

ObjectMethod · 0.92
processObjectFunction · 0.92
GetObjectFunction · 0.85
ObjectMethod · 0.85

Calls 5

DecodeCommitFunction · 0.85
DecodeTreeFunction · 0.85
DecodeBlobFunction · 0.85
DecodeTagFunction · 0.85
TypeMethod · 0.65

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…