  * @return integer of count of parents
  */
 GIT_EXTERN(unsigned int) git_commit_parentcount(git_commit *commit);
-
-/**
- * Get the specified parent of the commit.
- *
- * @param parent Pointer where to store the parent commit
- * @param commit a previously loaded commit.
- * @param n the position of the parent (from 0 to `parentcount`)
- * @return 0 on success; error code otherwise
- */
-GIT_EXTERN(int) git_commit_parent(git_commit **parent, git_commit *commit, unsigned int n);
-
+-}
+
+parent :: Commit -> Int -> IO (Either GitError Commit)
+parent (Commit c) n = alloca $ \parent -> do
+  res <- {#call git_commit_parent#} parent c (fromIntegral n)
+  retEither res $ fmap (Right . Commit) $ peek parent
+
+{-
 /**
  * Get the oid of a specified parent for a commit. This is different from
  * `git_commit_parent`, which will attempt to load the parent commit from

retMaybeRes res | res == 0  = return Nothing
                | otherwise = return $ Just . toEnum . fromIntegral $ res

blobFromBuffer :: ObjID -> Repository -> CPtr -> IO (Maybe GitError)
blobFromBuffer (ObjID objId) (Repository repo) buf = do
  res <- {#call git_blob_create_frombuffer#} objId repo buf

author (Commit c) = unsafePerformIO $
  return . Signature =<< {#call unsafe git_commit_author#} c

tree :: Commit -> IO (Either GitError Tree)
tree (Commit c) = alloca $ \tree -> do
  res <- {#call git_commit_tree#} tree c
  retEither res $ fmap (Right . Tree) $ peek tree

{-
/**
 * Get the id of the tree pointed to by a commit. This differs from
 * `git_commit_tree` in that no attempts are made to fetch an object
