summaryrefslogtreecommitdiff
path: root/src
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 /src
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 'src')
-rw-r--r--src/repository.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/repository.c b/src/repository.c
index 471c02444..c428b00af 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -488,3 +488,14 @@ int git_repository_is_empty(git_repository *repo)
return git_reference_resolve(&branch, head) == GIT_SUCCESS ? 0 : 1;
}
+const char *git_repository_path(git_repository *repo)
+{
+ assert(repo);
+ return repo->path_repository;
+}
+
+const char *git_repository_workdir(git_repository *repo)
+{
+ assert(repo);
+ return repo->path_workdir;
+}