Description

Object is a generic representation of any git object. It is implemented by Commit, Tree, Blob and Tag, and includes the functions that are common to them.

Object is returned when an object could of any type. It is frequently used with a type cast to acquire the specific type of object:

func process(obj Object) {
	switch o := obj.(type) {
	case *Commit:
		// o is a Commit
	case *Tree:
		// o is a Tree
	case *Blob:
		// o is a Blob
	case *Tag:
		// o is a Tag
	}
}

This interface is intentionally different from core.Object, which is a lower level interface used by storage implementations to read and write objects.

Object is referenced in 1 repository

github.com/src-d/go-git