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:
authorJunio C Hamano <gitster@pobox.com>2021-04-08 23:23:25 +0300
committerJunio C Hamano <gitster@pobox.com>2021-04-08 23:23:25 +0300
commit22eee7f4554e777de93134c0ae06ee611bd570a4 (patch)
treeff7982688bc3eab633374f3ebdc53fb56abf3c03 /transport.c
parente6b971fcf5d85db821636f2d887cfaf204b32bda (diff)
parent4fe788b1b0ee6150173580d8fa70e7d5788cf7d3 (diff)
Merge branch 'll/clone-reject-shallow'
"git clone --reject-shallow" option fails the clone as soon as we notice that we are cloning from a shallow repository. * ll/clone-reject-shallow: builtin/clone.c: add --reject-shallow option
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/transport.c b/transport.c
index eb4b2d4e47..ef66e73090 100644
--- a/transport.c
+++ b/transport.c
@@ -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;