code: func ParseObjectType(value string) (typ ObjectType, err error) {
  	switch value {
  	case "commit":
  		typ = CommitObject
  	case "tree":
  		typ = TreeObject
  	case "blob":
  		typ = BlobObject
  	case "tag":
  		typ = TagObject
  	case "ofs-delta":
  		typ = OFSDeltaObject
  	case "ref-delta":
  		typ = REFDeltaObject
  	default:
  		err = ErrInvalidType
  	}
  	return
  }
docs: // ParseObjectType parses a string representation of ObjectType. It returns an
  // error on parse failure.