diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-04-08 13:23:25 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-04-08 13:23:25 -0700 |
commit | 22eee7f4554e777de93134c0ae06ee611bd570a4 (patch) | |
tree | ff7982688bc3eab633374f3ebdc53fb56abf3c03 /transport.c | |
parent | e6b971fcf5d85db821636f2d887cfaf204b32bda (diff) | |
parent | 4fe788b1b0ee6150173580d8fa70e7d5788cf7d3 (diff) | |
download | git-22eee7f4554e777de93134c0ae06ee611bd570a4.tar.gz |
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.c | 4 |
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; |