diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2023-04-22 23:42:41 +0100 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2023-04-24 11:49:16 +0100 |
commit | 48273490e7ccfaa56b784c69cb488111bd06f357 (patch) | |
tree | 02a4c80d0698fb651f080896bb7faf2d96b899ab /src/libgit2/repository.c | |
parent | 6cec01b4d8498203ae3a03949ffd480845269a3d (diff) | |
download | libgit2-48273490e7ccfaa56b784c69cb488111bd06f357.tar.gz |
shallow: use GIT_ASSERT (not assert)
Diffstat (limited to 'src/libgit2/repository.c')
-rw-r--r-- | src/libgit2/repository.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libgit2/repository.c b/src/libgit2/repository.c index 99982b724..3b6ecae24 100644 --- a/src/libgit2/repository.c +++ b/src/libgit2/repository.c @@ -1613,14 +1613,16 @@ int git_repository_set_index(git_repository *repo, git_index *index) int git_repository_grafts__weakptr(git_grafts **out, git_repository *repo) { - assert(out && repo && repo->grafts); + GIT_ASSERT_ARG(out && repo); + GIT_ASSERT(repo->grafts); *out = repo->grafts; return 0; } int git_repository_shallow_grafts__weakptr(git_grafts **out, git_repository *repo) { - assert(out && repo && repo->shallow_grafts); + GIT_ASSERT_ARG(out && repo); + GIT_ASSERT(repo->shallow_grafts); *out = repo->shallow_grafts; return 0; } @@ -3672,7 +3674,7 @@ int git_repository__shallow_roots_write(git_repository *repo, git_array_oid_t ro git_oid *oid; int filebuf_hash, error = 0; - assert(repo); + GIT_ASSERT_ARG(repo); filebuf_hash = git_filebuf_hash_flags(git_oid_algorithm(GIT_OID_SHA1)); GIT_ASSERT(filebuf_hash); @@ -3695,9 +3697,8 @@ int git_repository__shallow_roots_write(git_repository *repo, git_array_oid_t ro goto on_error; } - if (git_array_size(roots) == 0) { + if (git_array_size(roots) == 0) remove(path.ptr); - } on_error: git_str_dispose(&path); |