vendor/libgit2/src/reader.c in rugged-1.1.1 vs vendor/libgit2/src/reader.c in rugged-1.2.0
- old
+ new
@@ -59,11 +59,12 @@
int git_reader_for_tree(git_reader **out, git_tree *tree)
{
tree_reader *reader;
- assert(out && tree);
+ GIT_ASSERT_ARG(out);
+ GIT_ASSERT_ARG(tree);
reader = git__calloc(1, sizeof(tree_reader));
GIT_ERROR_CHECK_ALLOC(reader);
reader->reader.read = tree_reader_read;
@@ -95,12 +96,11 @@
git_filter_list *filters = NULL;
const git_index_entry *idx_entry;
git_oid id;
int error;
- if ((error = git_buf_joinpath(&path,
- git_repository_workdir(reader->repo), filename)) < 0)
+ if ((error = git_repository_workdir_path(&path, reader->repo, filename)) < 0)
goto done;
if ((error = p_lstat(path.ptr, &st)) < 0) {
if (error == -1 && errno == ENOENT)
error = GIT_ENOTFOUND;
@@ -156,11 +156,12 @@
bool validate_index)
{
workdir_reader *reader;
int error;
- assert(out && repo);
+ GIT_ASSERT_ARG(out);
+ GIT_ASSERT_ARG(repo);
reader = git__calloc(1, sizeof(workdir_reader));
GIT_ERROR_CHECK_ALLOC(reader);
reader->reader.read = workdir_reader_read;
@@ -221,11 +222,12 @@
git_index *index)
{
index_reader *reader;
int error;
- assert(out && repo);
+ GIT_ASSERT_ARG(out);
+ GIT_ASSERT_ARG(repo);
reader = git__calloc(1, sizeof(index_reader));
GIT_ERROR_CHECK_ALLOC(reader);
reader->reader.read = index_reader_read;
@@ -249,10 +251,12 @@
git_oid *out_id,
git_filemode_t *out_filemode,
git_reader *reader,
const char *filename)
{
- assert(out && reader && filename);
+ GIT_ASSERT_ARG(out);
+ GIT_ASSERT_ARG(reader);
+ GIT_ASSERT_ARG(filename);
return reader->read(out, out_id, out_filemode, reader, filename);
}
void git_reader_free(git_reader *reader)