Commit d4384977 by Edward Thomson

clone: use GIT_ASSERT

parent 5d8b75fa
...@@ -231,7 +231,7 @@ static int update_head_to_remote( ...@@ -231,7 +231,7 @@ static int update_head_to_remote(
/* We know we have HEAD, let's see where it points */ /* We know we have HEAD, let's see where it points */
remote_head = refs[0]; remote_head = refs[0];
assert(remote_head); GIT_ASSERT(remote_head);
remote_head_id = &remote_head->oid; remote_head_id = &remote_head->oid;
...@@ -267,7 +267,8 @@ static int update_head_to_branch( ...@@ -267,7 +267,8 @@ static int update_head_to_branch(
git_buf remote_branch_name = GIT_BUF_INIT; git_buf remote_branch_name = GIT_BUF_INIT;
git_reference* remote_ref = NULL; 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", if ((retcode = git_buf_printf(&remote_branch_name, GIT_REFS_REMOTES_DIR "%s/%s",
remote_name, branch)) < 0 ) remote_name, branch)) < 0 )
...@@ -385,7 +386,8 @@ static int clone_into(git_repository *repo, git_remote *_remote, const git_fetch ...@@ -385,7 +386,8 @@ static int clone_into(git_repository *repo, git_remote *_remote, const git_fetch
git_fetch_options fetch_opts; git_fetch_options fetch_opts;
git_remote *remote; git_remote *remote;
assert(repo && _remote); GIT_ASSERT_ARG(repo);
GIT_ASSERT_ARG(_remote);
if (!git_repository_is_empty(repo)) { if (!git_repository_is_empty(repo)) {
git_error_set(GIT_ERROR_INVALID, "the repository is not empty"); git_error_set(GIT_ERROR_INVALID, "the repository is not empty");
...@@ -452,7 +454,9 @@ static int git__clone( ...@@ -452,7 +454,9 @@ static int git__clone(
uint32_t rmdir_flags = GIT_RMDIR_REMOVE_FILES; uint32_t rmdir_flags = GIT_RMDIR_REMOVE_FILES;
git_repository_create_cb repository_cb; 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) if (_options)
memcpy(&options, _options, sizeof(git_clone_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_ ...@@ -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 src_odb = GIT_BUF_INIT, dst_odb = GIT_BUF_INIT, src_path = GIT_BUF_INIT;
git_buf reflog_message = 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)) { if (!git_repository_is_empty(repo)) {
git_error_set(GIT_ERROR_INVALID, "the repository is not empty"); git_error_set(GIT_ERROR_INVALID, "the repository is not empty");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment