commit 8d5493c9d912382b91a5a5ac9f25351040078e02 from: Mark Jamsek via: Thomas Adam date: Fri Jan 3 10:46:48 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 - fe354d70d4ad218c599cac447058537d734836e5 commit + 8d5493c9d912382b91a5a5ac9f25351040078e02 blob - 2f26d13b606488dfcb50b4273bb71e143d93b757 blob + 14381993fce1ddf1ccb7eba95347a6f3f2a79510 --- tog/tog.c +++ tog/tog.c @@ -10770,14 +10770,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();