static int update_local_ref(struct ref *ref,
struct ref_transaction *transaction,
const char *remote, const struct ref *remote_ref,
- struct strbuf *display, int summary_width,
- struct worktree **worktrees)
+ struct strbuf *display, int summary_width)
{
struct commit *current = NULL, *updated;
const char *pretty_ref = prettify_refname(ref->name);
static int store_updated_refs(const char *raw_url, const char *remote_name,
int connectivity_checked,
struct ref_transaction *transaction, struct ref *ref_map,
- struct fetch_head *fetch_head, struct worktree **worktrees)
+ struct fetch_head *fetch_head)
{
int url_len, i, rc = 0;
struct strbuf note = STRBUF_INIT, err = STRBUF_INIT;
strbuf_reset(¬e);
if (ref) {
rc |= update_local_ref(ref, transaction, what,
- rm, ¬e, summary_width,
- worktrees);
+ rm, ¬e, summary_width);
free(ref);
} else if (write_fetch_head || dry_run) {
/*
static int fetch_and_consume_refs(struct transport *transport,
struct ref_transaction *transaction,
struct ref *ref_map,
- struct fetch_head *fetch_head,
- struct worktree **worktrees)
+ struct fetch_head *fetch_head)
{
int connectivity_checked = 1;
int ret;
trace2_region_enter("fetch", "consume_refs", the_repository);
ret = store_updated_refs(transport->url, transport->remote->name,
connectivity_checked, transaction, ref_map,
- fetch_head, worktrees);
+ fetch_head);
trace2_region_leave("fetch", "consume_refs", the_repository);
out:
static int backfill_tags(struct transport *transport,
struct ref_transaction *transaction,
struct ref *ref_map,
- struct fetch_head *fetch_head,
- struct worktree **worktrees)
+ struct fetch_head *fetch_head)
{
int retcode, cannot_reuse;
transport_set_option(transport, TRANS_OPT_FOLLOWTAGS, NULL);
transport_set_option(transport, TRANS_OPT_DEPTH, "0");
transport_set_option(transport, TRANS_OPT_DEEPEN_RELATIVE, NULL);
- retcode = fetch_and_consume_refs(transport, transaction, ref_map, fetch_head, worktrees);
+ retcode = fetch_and_consume_refs(transport, transaction, ref_map, fetch_head);
if (gsecondary) {
transport_disconnect(gsecondary);
struct transport_ls_refs_options transport_ls_refs_options =
TRANSPORT_LS_REFS_OPTIONS_INIT;
int must_list_refs = 1;
- struct worktree **worktrees = get_worktrees();
struct fetch_head fetch_head = { 0 };
struct strbuf err = STRBUF_INIT;
retcode = 1;
}
- if (fetch_and_consume_refs(transport, transaction, ref_map, &fetch_head, worktrees)) {
+ if (fetch_and_consume_refs(transport, transaction, ref_map, &fetch_head)) {
retcode = 1;
goto cleanup;
}
* the transaction and don't commit anything.
*/
if (backfill_tags(transport, transaction, tags_ref_map,
- &fetch_head, worktrees))
+ &fetch_head))
retcode = 1;
}
close_fetch_head(&fetch_head);
strbuf_release(&err);
free_refs(ref_map);
- free_worktrees(worktrees);
return retcode;
}