commit - 5a950d099a15fa3dc29590f3a8e90de9d6e1972b
commit + b0c3aa90f1603016465bfb79b4fd860b7fec0e1b
blob - 156fdc229cc2ed2c606d5aded919cc4fa7adeaad
blob + 5cabaf1a22b6a5cf622da3f4b48394e7c7bb2e99
--- gotweb/gotweb.c
+++ gotweb/gotweb.c
unsigned int page;
unsigned int repos_total;
enum kmime mime;
+ int *pack_fds;
};
struct gw_header {
error = gw_output_blob_buf(gw_trans, header);
done:
-
if (error) {
gw_trans->mime = KMIME_TEXT_PLAIN;
err = gw_display_index(gw_trans);
struct got_reflist_head refs;
struct got_reflist_entry *re;
time_t committer_time = 0, cmp_time = 0;
- int *pack_fds = NULL;
*repo_age = NULL;
TAILQ_INIT(&refs);
if (gw_trans->repo)
repo = gw_trans->repo;
else {
- error = got_repo_pack_fds_open(&pack_fds);
- if (error != NULL)
- goto done;
- error = got_repo_open(&repo, dir, NULL, pack_fds);
+ error = got_repo_open(&repo, dir, NULL, gw_trans->pack_fds);
if (error)
return error;
}
const struct got_error *close_err = got_repo_close(repo);
if (error == NULL)
error = close_err;
- }
- if (pack_fds) {
- const struct got_error *pack_err =
- got_repo_pack_fds_close(pack_fds);
- if (error == NULL)
- error = pack_err;
}
return error;
}
const struct got_error *error = NULL, *close_err;
struct got_repository *repo;
const char *gitconfig_owner;
- int *pack_fds = NULL;
*owner = NULL;
if (gw_trans->gw_conf->got_show_repo_owner == 0)
return NULL;
- error = got_repo_pack_fds_open(&pack_fds);
- if (error != NULL)
- return error;
- error = got_repo_open(&repo, dir, NULL, pack_fds);
+ error = got_repo_open(&repo, dir, NULL, gw_trans->pack_fds);
if (error)
return error;
close_err = got_repo_close(repo);
if (error == NULL)
error = close_err;
- if (pack_fds) {
- const struct got_error *pack_err =
- got_repo_pack_fds_close(pack_fds);
- if (error == NULL)
- error = pack_err;
- }
return error;
}
char *in_repo_path = NULL;
struct got_object_id *id = NULL;
struct got_reference *ref;
- int *pack_fds = NULL;
- error = got_repo_pack_fds_open(&pack_fds);
- if (error != NULL)
- goto done;
error = got_repo_open(&gw_trans->repo, gw_trans->repo_path, NULL,
- pack_fds);
+ gw_trans->pack_fds);
if (error)
return error;
error = gw_get_commits(gw_trans, header, limit, id);
done:
- if (pack_fds) {
- const struct got_error *pack_err =
- got_repo_pack_fds_close(pack_fds);
- if (error == NULL)
- error = pack_err;
- }
free(id);
free(in_repo_path);
return error;
gw_trans->gw_tmpl->arg = gw_trans;
gw_trans->gw_tmpl->cb = gw_template;
+ error = got_repo_pack_fds_open(&gw_trans->pack_fds);
+ if (error != NULL)
+ goto done;
+
error = parse_gotweb_config(&gw_trans->gw_conf, GOTWEB_CONF);
if (error)
goto done;
}
cleanup:
+ if (gw_trans->pack_fds) {
+ const struct got_error *pack_err =
+ got_repo_pack_fds_close(gw_trans->pack_fds);
+ if (error == NULL)
+ error = pack_err;
+ }
free(gw_trans->gw_conf->got_repos_path);
free(gw_trans->gw_conf->got_www_path);
free(gw_trans->gw_conf->got_site_name);