diff options
| author | Vicent Marti <tanoku@gmail.com> | 2011-06-04 20:44:14 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-06-04 20:45:09 +0200 |
| commit | 602ee38b6e874f61f162ca7239c3a6d8c6099335 (patch) | |
| tree | d1ea414172f86c1aba25c33544d63296f17bda04 /src/repository.c | |
| parent | 793545ef2bc0eb8b331ac715e77a3a77c8225320 (diff) | |
| download | libgit2-602ee38b6e874f61f162ca7239c3a6d8c6099335.tar.gz | |
repository: Export all internal paths
Diffstat (limited to 'src/repository.c')
| -rw-r--r-- | src/repository.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/repository.c b/src/repository.c index 0b67d144c..249755b62 100644 --- a/src/repository.c +++ b/src/repository.c @@ -721,16 +721,26 @@ 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) +const char *git_repository_path(git_repository *repo, git_repository_pathid id) { assert(repo); - return repo->path_repository; -} -const char *git_repository_workdir(git_repository *repo) -{ - assert(repo); - return repo->path_workdir; + switch (id) { + case GIT_REPO_PATH: + return repo->path_repository; + + case GIT_REPO_PATH_INDEX: + return repo->path_index; + + case GIT_REPO_PATH_ODB: + return repo->path_odb; + + case GIT_REPO_PATH_WORKDIR: + return repo->path_workdir; + + default: + return NULL; + } } int git_repository_is_bare(git_repository *repo) |
