Add the ability to check if a mempack is empty

Implement git_mempack_empty, which returns 1 if the mempack is empty
and 0 otherwise.
This commit is contained in:
Vladyslav Yeremeichuk
2024-10-21 22:42:56 +03:00
parent 229181bf9b
commit d1be60bbe8
3 changed files with 30 additions and 4 deletions

View File

@@ -101,6 +101,14 @@ GIT_EXTERN(int) git_mempack_dump(git_buf *pack, git_repository *repo, git_odb_ba
*/
GIT_EXTERN(int) git_mempack_reset(git_odb_backend *backend);
/**
* Checks if mempack is empty
*
* @param backend The mempack backend
* @return 1 if the repository is empty, 0 if it isn't
*/
GIT_EXTERN(int) git_mempack_empty(git_odb_backend *backend);
GIT_END_DECL
#endif