 	/// cannot be loaded.
 	func withLibgit2Object<T>(oid: OID, type: git_otype, transform: COpaquePointer -> Result<T, NSError>) -> Result<T, NSError> {
 		var pointer: COpaquePointer = nil
-		let repository = self.pointer
 		var oid = oid.oid
-		let result = git_object_lookup(&pointer, repository, &oid, type)
+		let result = git_object_lookup(&pointer, self.pointer, &oid, type)
 		
 		if result != GIT_OK.value {
 			return failure(libGit2Error(result, libGit2PointOfFailure: "git_object_lookup"))

	/// Returns an array of remotes, or an error.
	public func allRemotes() -> Result<[Remote], NSError> {
		let pointer = UnsafeMutablePointer<git_strarray>.alloc(1)
		let repository = self.pointer
		let result = git_remote_list(pointer, repository)
		
		if result != GIT_OK.value {
			pointer.dealloc(1)

	/// `Reference` will be returned.
	public func referenceWithName(name: String) -> Result<ReferenceType, NSError> {
		var pointer: COpaquePointer = nil
		let result = git_reference_lookup(&pointer, self.pointer, name)
		
		if result != GIT_OK.value {
			return failure(libGit2Error(result, libGit2PointOfFailure: "git_reference_lookup"))
