commit a37d050fd5d5734fa796408ef3f12f56ca393be8 from: Stefan Sperling date: Fri Jan 26 13:37:13 2018 UTC make the read_log() tests fail if some objects cannot be read commit - b08fe7be6d83b5a2707836cdae994156b426fc53 commit + a37d050fd5d5734fa796408ef3f12f56ca393be8 blob - 5ca8cd8bc3eca6b268ca2550925b0da4bd9e4e46 blob + ac7b3266c0c21b958f271f3c44bf229ed5882bd0 --- regress/repository/repository_test.c +++ regress/repository/repository_test.c @@ -39,7 +39,7 @@ print_parent_commits(struct got_commit_object *commit, 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) { @@ -48,11 +48,11 @@ print_parent_commits(struct got_commit_object *commit, 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 * @@ -175,8 +175,12 @@ repo_read_log(const char *repo_path) 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);