Skip to content

Commit 82050fa

Browse files
committed
mempack functions: return an int
Stop returning a void for functions, future-proofing them to allow them to fail.
1 parent a3126a7 commit 82050fa

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

include/git2/sys/mempack.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ GIT_EXTERN(int) git_mempack_dump(git_buf *pack, git_repository *repo, git_odb_ba
7878
* semantics to the Git repository.
7979
*
8080
* @param backend The mempack backend
81+
* @return 0 on success; error code otherwise
8182
*/
82-
GIT_EXTERN(void) git_mempack_reset(git_odb_backend *backend);
83+
GIT_EXTERN(int) git_mempack_reset(git_odb_backend *backend);
8384

8485
GIT_END_DECL
8586

src/odb_mempack.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ int git_mempack_dump(git_buf *pack, git_repository *repo, git_odb_backend *_back
125125
return err;
126126
}
127127

128-
void git_mempack_reset(git_odb_backend *_backend)
128+
int git_mempack_reset(git_odb_backend *_backend)
129129
{
130130
struct memory_packer_db *db = (struct memory_packer_db *)_backend;
131131
struct memobject *object = NULL;
@@ -137,6 +137,8 @@ void git_mempack_reset(git_odb_backend *_backend)
137137
git_array_clear(db->commits);
138138

139139
git_oidmap_clear(db->objects);
140+
141+
return 0;
140142
}
141143

142144
static void impl__free(git_odb_backend *_backend)

0 commit comments

Comments
 (0)