commit 0f35fb6b3d80924fd72c566d007ffb01728f43ba from: Mark Jamsek date: Wed Jan 01 00:35:41 2025 UTC tog: don't clobber error with got_repo_close() error While here, style(9) the adjacent block: remove function call from initializer. ok stsp@ commit - 919e5e7241ba484d4893ddf26b9c6f21877be3b5 commit + 0f35fb6b3d80924fd72c566d007ffb01728f43ba blob - 8d227eff283fc8287e36b66f666eb4a49d584018 blob + 4eb0e6acc9ff0cfb7f844d192808a181c12ecfec --- tog/tog.c +++ tog/tog.c @@ -10766,14 +10766,17 @@ done: if (worktree != NULL) got_worktree_close(worktree); if (repo) { - const struct got_error *close_err = got_repo_close(repo); - if (close_err) + const struct got_error *close_err; + + close_err = got_repo_close(repo); + if (close_err && error == NULL) error = close_err; } if (pack_fds) { - const struct got_error *pack_err = - got_repo_pack_fds_close(pack_fds); - if (error == NULL) + const struct got_error *pack_err; + + pack_err = got_repo_pack_fds_close(pack_fds); + if (pack_err && error == NULL) error = pack_err; } tog_free_refs();