 		}
 	}
 	
+	public var type: git_otype {
+		switch self {
+		case let Commit(oid):
+			return GIT_OBJ_COMMIT
+		case let Tree(oid):
+			return GIT_OBJ_TREE
+		case let Blob(oid):
+			return GIT_OBJ_BLOB
+		case let Tag(oid):
+			return GIT_OBJ_TAG
+		}
+	}
+	
+	/// Create an instance with an OID and a libgit2 `git_otype`.
 	init?(oid: OID, type: git_otype) {
 		switch type.value {
 		case GIT_OBJ_COMMIT.value:

import Foundation

/// A pointer to a git object.
public enum Pointer {
	case Commit(OID)
	case Tree(OID)
	case Blob(OID)
	case Tag(OID)
	
	var oid: OID {
		switch self {
		case let Commit(oid):
			return oid

	}
}

/// A git object.
public protocol ObjectType {
	/// The OID of the object.
