commit - 565f18a82d800171c586b1877798c6e794b56505
commit + 7755e2f80723b22eb4fcc203ffd75608db7055c7
blob - 8ff7e074110ce8eb022c3fee11169b99a0e583fe
blob + 9553f7382f214cf420ca01efb9c1237b54d89984
--- got/got.c
+++ got/got.c
got_repo_pack_fds_close(pack_fds);
if (error == NULL)
error = pack_err;
+ }
+ if (repo) {
+ const struct got_error *close_err = got_repo_close(repo);
+ if (error == NULL)
+ error = close_err;
}
if (preserve_logmsg) {
fprintf(stderr, "%s: log message preserved in %s\n",
got_ref_close(head_ref);
if (ref)
got_ref_close(ref);
+ if (repo) {
+ const struct got_error *close_err = got_repo_close(repo);
+ if (error == NULL)
+ error = close_err;
+ }
got_pathlist_free(&paths, GOT_PATHLIST_FREE_NONE);
free(commit_id_str);
free(commit_id);
"'got checkout'.\n"
"The got(1) manual page contains more information.", cmdname);
err = got_error_msg(GOT_ERR_NOT_WORKTREE, msg);
- got_repo_close(repo);
+ if (repo) {
+ const struct got_error *close_err = got_repo_close(repo);
+ if (close_err == NULL)
+ err = close_err;
+ }
if (pack_fds) {
const struct got_error *pack_err =
got_repo_pack_fds_close(pack_fds);
got_repo_pack_fds_close(pack_fds);
if (error == NULL)
error = pack_err;
+ }
+ if (repo) {
+ const struct got_error *close_err = got_repo_close(repo);
+ if (error == NULL)
+ error = close_err;
}
free(worktree_path);
got_pathlist_free(&paths, GOT_PATHLIST_FREE_PATH);
if (error == NULL)
error = pack_err;
}
+ if (repo) {
+ const struct got_error *close_err = got_repo_close(repo);
+ if (error == NULL)
+ error = close_err;
+ }
got_pathlist_free(&paths, GOT_PATHLIST_FREE_PATH);
free(cwd);