From 82050fa1bebbe3ea7627af0d5f8c5c3e3920493a Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Sat, 18 Jan 2020 17:53:26 +0000 Subject: mempack functions: return an int Stop returning a void for functions, future-proofing them to allow them to fail. --- include/git2/sys/mempack.h | 3 ++- src/odb_mempack.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/git2/sys/mempack.h b/include/git2/sys/mempack.h index 63fb38dc8..17da590a3 100644 --- a/include/git2/sys/mempack.h +++ b/include/git2/sys/mempack.h @@ -78,8 +78,9 @@ GIT_EXTERN(int) git_mempack_dump(git_buf *pack, git_repository *repo, git_odb_ba * semantics to the Git repository. * * @param backend The mempack backend + * @return 0 on success; error code otherwise */ -GIT_EXTERN(void) git_mempack_reset(git_odb_backend *backend); +GIT_EXTERN(int) git_mempack_reset(git_odb_backend *backend); GIT_END_DECL diff --git a/src/odb_mempack.c b/src/odb_mempack.c index 6728c6c42..69c423bec 100644 --- a/src/odb_mempack.c +++ b/src/odb_mempack.c @@ -125,7 +125,7 @@ cleanup: return err; } -void git_mempack_reset(git_odb_backend *_backend) +int git_mempack_reset(git_odb_backend *_backend) { struct memory_packer_db *db = (struct memory_packer_db *)_backend; struct memobject *object = NULL; @@ -137,6 +137,8 @@ void git_mempack_reset(git_odb_backend *_backend) git_array_clear(db->commits); git_oidmap_clear(db->objects); + + return 0; } static void impl__free(git_odb_backend *_backend) -- cgit v1.2.1