clone: use GIT_ASSERT
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
diff --git a/src/clone.c b/src/clone.c
index a93ec47..7ae90b0 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -231,7 +231,7 @@ static int update_head_to_remote(
/* We know we have HEAD, let's see where it points */
remote_head = refs[0];
- assert(remote_head);
+ GIT_ASSERT(remote_head);
remote_head_id = &remote_head->oid;
@@ -267,7 +267,8 @@ static int update_head_to_branch(
git_buf remote_branch_name = GIT_BUF_INIT;
git_reference* remote_ref = NULL;
- assert(remote_name && branch);
+ GIT_ASSERT_ARG(remote_name);
+ GIT_ASSERT_ARG(branch);
if ((retcode = git_buf_printf(&remote_branch_name, GIT_REFS_REMOTES_DIR "%s/%s",
remote_name, branch)) < 0 )
@@ -385,7 +386,8 @@ static int clone_into(git_repository *repo, git_remote *_remote, const git_fetch
git_fetch_options fetch_opts;
git_remote *remote;
- assert(repo && _remote);
+ GIT_ASSERT_ARG(repo);
+ GIT_ASSERT_ARG(_remote);
if (!git_repository_is_empty(repo)) {
git_error_set(GIT_ERROR_INVALID, "the repository is not empty");
@@ -452,7 +454,9 @@ static int git__clone(
uint32_t rmdir_flags = GIT_RMDIR_REMOVE_FILES;
git_repository_create_cb repository_cb;
- assert(out && url && local_path);
+ GIT_ASSERT_ARG(out);
+ GIT_ASSERT_ARG(url);
+ GIT_ASSERT_ARG(local_path);
if (_options)
memcpy(&options, _options, sizeof(git_clone_options));
@@ -575,7 +579,8 @@ static int clone_local_into(git_repository *repo, git_remote *remote, const git_
git_buf src_odb = GIT_BUF_INIT, dst_odb = GIT_BUF_INIT, src_path = GIT_BUF_INIT;
git_buf reflog_message = GIT_BUF_INIT;
- assert(repo && remote);
+ GIT_ASSERT_ARG(repo);
+ GIT_ASSERT_ARG(remote);
if (!git_repository_is_empty(repo)) {
git_error_set(GIT_ERROR_INVALID, "the repository is not empty");