diff options
| author | Patrick Steinhardt <ps@pks.im> | 2017-05-23 12:56:41 +0200 |
|---|---|---|
| committer | Patrick Steinhardt <ps@pks.im> | 2017-10-09 11:19:42 +0200 |
| commit | d02cf564a012ea8f6d4d4fd70a3102b94058f759 (patch) | |
| tree | 9db2666404c39bf57ed438d2f24fb362d1938d56 /include | |
| parent | f38ce9b61dee1bb2d3ba495937c685311f196574 (diff) | |
| download | libgit2-d02cf564a012ea8f6d4d4fd70a3102b94058f759.tar.gz | |
repository: constify several repo parameters for getters
Several functions to retrieve variables from a repository only return
immutable values, which allows us to actually constify the passed-in
repository parameter. Do so to help a later patch, which will only have
access to a constant repository.
Diffstat (limited to 'include')
| -rw-r--r-- | include/git2/repository.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/git2/repository.h b/include/git2/repository.h index 8aac0b3f7..6e0c1f71e 100644 --- a/include/git2/repository.h +++ b/include/git2/repository.h @@ -440,7 +440,7 @@ typedef enum { * @param item The repository item for which to retrieve the path * @return 0, GIT_ENOTFOUND if the path cannot exist or an error code */ -GIT_EXTERN(int) git_repository_item_path(git_buf *out, git_repository *repo, git_repository_item_t item); +GIT_EXTERN(int) git_repository_item_path(git_buf *out, const git_repository *repo, git_repository_item_t item); /** * Get the path of this repository @@ -451,7 +451,7 @@ GIT_EXTERN(int) git_repository_item_path(git_buf *out, git_repository *repo, git * @param repo A repository object * @return the path to the repository */ -GIT_EXTERN(const char *) git_repository_path(git_repository *repo); +GIT_EXTERN(const char *) git_repository_path(const git_repository *repo); /** * Get the path of the working directory for this repository @@ -462,7 +462,7 @@ GIT_EXTERN(const char *) git_repository_path(git_repository *repo); * @param repo A repository object * @return the path to the working dir, if it exists */ -GIT_EXTERN(const char *) git_repository_workdir(git_repository *repo); +GIT_EXTERN(const char *) git_repository_workdir(const git_repository *repo); /** * Get the path of the shared common directory for this repository @@ -473,7 +473,7 @@ GIT_EXTERN(const char *) git_repository_workdir(git_repository *repo); * @param repo A repository object * @return the path to the common dir */ -GIT_EXTERN(const char *) git_repository_commondir(git_repository *repo); +GIT_EXTERN(const char *) git_repository_commondir(const git_repository *repo); /** * Set the path to the working directory for this repository @@ -501,7 +501,7 @@ GIT_EXTERN(int) git_repository_set_workdir( * @param repo Repo to test * @return 1 if the repository is bare, 0 otherwise. */ -GIT_EXTERN(int) git_repository_is_bare(git_repository *repo); +GIT_EXTERN(int) git_repository_is_bare(const git_repository *repo); /** * Check if a repository is a linked work tree @@ -509,7 +509,7 @@ GIT_EXTERN(int) git_repository_is_bare(git_repository *repo); * @param repo Repo to test * @return 1 if the repository is a linked work tree, 0 otherwise. */ -GIT_EXTERN(int) git_repository_is_worktree(git_repository *repo); +GIT_EXTERN(int) git_repository_is_worktree(const git_repository *repo); /** * Get the configuration file for this repository. |
