commit - b08fe7be6d83b5a2707836cdae994156b426fc53
commit + a37d050fd5d5734fa796408ef3f12f56ca393be8
blob - 5ca8cd8bc3eca6b268ca2550925b0da4bd9e4e46
blob + ac7b3266c0c21b958f271f3c44bf229ed5882bd0
--- regress/repository/repository_test.c
+++ regress/repository/repository_test.c
struct got_repository *repo)
{
struct got_parent_id *pid;
- const struct got_error *err;
+ const struct got_error *err = NULL;
struct got_object *obj;
SIMPLEQ_FOREACH(pid, &commit->parent_ids, entry) {
return err;
if (got_object_get_type(obj) != GOT_OBJ_TYPE_COMMIT)
return got_error(GOT_ERR_OBJ_TYPE);
- print_commit_object(obj, repo);
+ err = print_commit_object(obj, repo);
got_object_close(obj);
}
- return NULL;
+ return err;
}
static const struct got_error *
err = got_object_open(&obj, repo, id);
if (err != NULL || obj == NULL)
return 0;
- if (got_object_get_type(obj) == GOT_OBJ_TYPE_COMMIT)
- print_commit_object(obj, repo);
+ if (got_object_get_type(obj) == GOT_OBJ_TYPE_COMMIT) {
+ err = print_commit_object(obj, repo);
+ if (err)
+ return 0;
+ } else
+ return 0;
got_object_close(obj);
free(id);
got_ref_close(head_ref);