Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/transport.c b/transport.c
index b13fab5dc3..62b6eeed21 100644
--- a/transport.c
+++ b/transport.c
@@ -108,11 +108,11 @@ static void set_upstreams(struct transport *transport, struct ref *refs,
if (!remotename || !starts_with(remotename, "refs/heads/"))
continue;
- if (!pretend)
- install_branch_config(BRANCH_CONFIG_VERBOSE,
- localname + 11, transport->remote->name,
- remotename);
- else
+ if (!pretend) {
+ int flag = transport->verbose < 0 ? 0 : BRANCH_CONFIG_VERBOSE;
+ install_branch_config(flag, localname + 11,
+ transport->remote->name, remotename);
+ } else if (transport->verbose >= 0)
printf(_("Would set upstream of '%s' to '%s' of '%s'\n"),
localname + 11, remotename + 11,
transport->remote->name);
@@ -236,6 +236,9 @@ static int set_git_option(struct git_transport_options *opts,
list_objects_filter_die_if_populated(&opts->filter_options);
parse_list_objects_filter(&opts->filter_options, value);
return 0;
+ } else if (!strcmp(name, TRANS_OPT_REJECT_SHALLOW)) {
+ opts->reject_shallow = !!value;
+ return 0;
}
return 1;
}
@@ -370,6 +373,7 @@ static int fetch_refs_via_pack(struct transport *transport,
args.stateless_rpc = transport->stateless_rpc;
args.server_options = transport->server_options;
args.negotiation_tips = data->options.negotiation_tips;
+ args.reject_shallow_remote = transport->smart_options->reject_shallow;
if (!data->got_remote_heads) {
int i;
@@ -871,7 +875,7 @@ void transport_take_over(struct transport *transport,
BUG("taking over transport requires non-NULL "
"smart_options field.");
- data = xcalloc(1, sizeof(*data));
+ CALLOC_ARRAY(data, 1);
data->options = *transport->smart_options;
data->conn = child;
data->fd[0] = data->conn->out;
@@ -1452,6 +1456,8 @@ int transport_disconnect(struct transport *transport)
int ret = 0;
if (transport->vtable->disconnect)
ret = transport->vtable->disconnect(transport);
+ if (transport->got_remote_refs)
+ free_refs((void *)transport->remote_refs);
free(transport);
return ret;
}