DecodeObject decodes an encoded object into an Object and associates it to the given object storer.
(s storer.EncodedObjectStorer, o plumbing.EncodedObject)
| 60 | // DecodeObject decodes an encoded object into an Object and associates it to |
| 61 | // the given object storer. |
| 62 | func 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 |
| 78 | const DateFormat = "Mon Jan 02 15:04:05 2006 -0700" |
searching dependent graphs…