   res  <- {#call git_repository_init#} pprepo pstr (fromBool isBare)
   retEither res $ fmap (Right . Repository) $ peek pprepo
 
-retEither :: CInt -> IO (Either GitError a) -> IO (Either GitError a)
-retEither res f | res == 0  = f
-                | otherwise = return . Left . toEnum . fromIntegral $ res
-
 isHeadDetached :: Repository -> IO Bool
 isHeadDetached = repoIs {#call git_repository_head_detached#}
 

  pathStr  <- newCString path
  res      <- {#call git_blob_create_fromfile #} obj repo pathStr
  retMaybeRes res

retMaybeRes :: CInt -> IO (Maybe GitError)
retMaybeRes res | res == 0  = return Nothing
                | otherwise = return $ Just . toEnum . fromIntegral $ res

-- TODO: CPtr here?
blobFromBuffer :: ObjID -> Repository -> CPtr -> IO (Maybe GitError)


deriving instance Show GitError



retEither :: CInt -> IO (Either GitError a) -> IO (Either GitError a)
retEither res f | res == 0  = f
                | otherwise = return . Left . toEnum . fromIntegral $ res


retMaybeRes :: CInt -> IO (Maybe GitError)
retMaybeRes res | res == 0  = return Nothing
                | otherwise = return $ Just . toEnum . fromIntegral $ res


-------------------------------------------------------------------------------
-- BEGIN: blob.h
-------------------------------------------------------------------------------
