diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2020-01-18 17:50:38 +0000 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2020-01-24 15:12:56 -0600 |
commit | a3126a72d2ae034be9ab3cb06b25b314e7e9c639 (patch) | |
tree | f50a772de989a3f912c7d8de91afb64c9f662f73 /include | |
parent | cb43274a6b1eae490ab301f80ff13a69fe252610 (diff) | |
download | libgit2-a3126a72d2ae034be9ab3cb06b25b314e7e9c639.tar.gz |
repository functions: return an int
Stop returning a void for functions, future-proofing them to allow them
to fail.
Diffstat (limited to 'include')
-rw-r--r-- | include/git2/sys/repository.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/git2/sys/repository.h b/include/git2/sys/repository.h index ea2773fd8..892be6692 100644 --- a/include/git2/sys/repository.h +++ b/include/git2/sys/repository.h @@ -44,8 +44,11 @@ GIT_EXTERN(int) git_repository_new(git_repository **out); * trying to aggressively cleanup the repo before its * deallocation. `git_repository_free` already performs this operation * before deallocating the repo. + * + * @param repo The repository to clean up + * @return 0 on success, or an error code */ -GIT_EXTERN(void) git_repository__cleanup(git_repository *repo); +GIT_EXTERN(int) git_repository__cleanup(git_repository *repo); /** * Update the filesystem config settings for an open repository @@ -78,8 +81,9 @@ GIT_EXTERN(int) git_repository_reinit_filesystem( * * @param repo A repository object * @param config A Config object + * @return 0 on success, or an error code */ -GIT_EXTERN(void) git_repository_set_config(git_repository *repo, git_config *config); +GIT_EXTERN(int) git_repository_set_config(git_repository *repo, git_config *config); /** * Set the Object Database for this repository @@ -93,8 +97,9 @@ GIT_EXTERN(void) git_repository_set_config(git_repository *repo, git_config *con * * @param repo A repository object * @param odb An ODB object + * @return 0 on success, or an error code */ -GIT_EXTERN(void) git_repository_set_odb(git_repository *repo, git_odb *odb); +GIT_EXTERN(int) git_repository_set_odb(git_repository *repo, git_odb *odb); /** * Set the Reference Database Backend for this repository @@ -108,8 +113,9 @@ GIT_EXTERN(void) git_repository_set_odb(git_repository *repo, git_odb *odb); * * @param repo A repository object * @param refdb An refdb object + * @return 0 on success, or an error code */ -GIT_EXTERN(void) git_repository_set_refdb(git_repository *repo, git_refdb *refdb); +GIT_EXTERN(int) git_repository_set_refdb(git_repository *repo, git_refdb *refdb); /** * Set the index file for this repository @@ -123,8 +129,9 @@ GIT_EXTERN(void) git_repository_set_refdb(git_repository *repo, git_refdb *refdb * * @param repo A repository object * @param index An index object + * @return 0 on success, or an error code */ -GIT_EXTERN(void) git_repository_set_index(git_repository *repo, git_index *index); +GIT_EXTERN(int) git_repository_set_index(git_repository *repo, git_index *index); /** * Set a repository to be bare. |