summaryrefslogtreecommitdiff
path: root/src/git
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2010-09-12 23:43:21 +0300
committerVicent Marti <tanoku@gmail.com>2010-09-12 23:43:21 +0300
commit46f8566a13564f0566a80b3df5950d1938cd222b (patch)
tree8d7f32f695ce6d0a7ab79841bfd44c3b8031e786 /src/git
parent370ce56910b9e506b22c7b673ef630a046b90126 (diff)
downloadlibgit2-46f8566a13564f0566a80b3df5950d1938cd222b.tar.gz
Add methods to access internal attributes in git_repo
Added several methods to access: - The ODB behind a repo - The SHA1 id behind a generic repo object - The type of a generic repo object Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/git')
-rw-r--r--src/git/repository.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/git/repository.h b/src/git/repository.h
index 001e4e9fb..a61e5b6cc 100644
--- a/src/git/repository.h
+++ b/src/git/repository.h
@@ -49,6 +49,29 @@ GIT_EXTERN(git_repository *) git_repository_alloc(git_odb *odb);
*/
GIT_EXTERN(git_repository_object *) git_repository_lookup(git_repository *repo, const git_oid *id, git_otype type);
+/**
+ * Get the object database behind a Git repository
+ *
+ * @param repo a repository object
+ * @return a pointer to the object db
+ */
+GIT_EXTERN(git_odb *) git_repository_database(git_repository *repo);
+
+/**
+ * Get the id (SHA1) of a repository object
+ *
+ * @param obj the repository object
+ * @return the SHA1 id
+ */
+const git_oid *git_repository_object_id(git_repository_object *obj);
+
+/**
+ * Get the object type of an object
+ *
+ * @param obj the repository object
+ * @return the object's type
+ */
+git_otype git_repository_object_type(git_repository_object *obj);
/**
* Free a reference to one of the objects in the repostory.