summaryrefslogtreecommitdiff
path: root/include/git2/repository.h
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2011-04-09 15:49:44 +0200
committerVicent Marti <tanoku@gmail.com>2011-04-09 15:25:24 -0700
commit4a34b3a9ff796f2324d59eb598595be62934acdf (patch)
tree9612e2c1ae691221c1b1eb56e32730a117412218 /include/git2/repository.h
parentc6e65acae63bd9b251140184679ab4ea0ec5c1a9 (diff)
downloadlibgit2-4a34b3a9ff796f2324d59eb598595be62934acdf.tar.gz
Add two new accessors to the repository
git_repository_path() and git_repository_workdir() respectively return the path to the git repository and the working directory. Those paths are absolute and normalized.
Diffstat (limited to 'include/git2/repository.h')
-rw-r--r--include/git2/repository.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/git2/repository.h b/include/git2/repository.h
index 200f350b..c47fcfc9 100644
--- a/include/git2/repository.h
+++ b/include/git2/repository.h
@@ -194,6 +194,24 @@ GIT_EXTERN(int) git_repository_init(git_repository **repo_out, const char *path,
*/
GIT_EXTERN(int) git_repository_is_empty(git_repository *repo);
+/**
+ * Get the normalized path to the git repository.
+ *
+ * @param repo a repository object
+ * @return absolute path to the git directory
+ */
+GIT_EXTERN(const char *) git_repository_path(git_repository *repo);
+
+/**
+ * Get the normalized path to the working directory of the repository.
+ *
+ * If the repository is bare, there is no working directory and NULL we be returned.
+ *
+ * @param repo a repository object
+ * @return NULL if the repository is bare; absolute path to the working directory otherwise.
+ */
+GIT_EXTERN(const char *) git_repository_workdir(git_repository *repo);
+
/** @} */
GIT_END_DECL
#endif