MCPcopy Create free account
hub / github.com/git/git / add_shallow_requests

Function add_shallow_requests

fetch-pack.c:1281–1301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1279}
1280
1281static void add_shallow_requests(struct strbuf *req_buf,
1282 const struct fetch_pack_args *args)
1283{
1284 if (is_repository_shallow(the_repository))
1285 write_shallow_commits(req_buf, 1, NULL);
1286 if (args->depth > 0)
1287 packet_buf_write(req_buf, "deepen %d", args->depth);
1288 if (args->deepen_since) {
1289 timestamp_t max_age = approxidate(args->deepen_since);
1290 packet_buf_write(req_buf, "deepen-since %"PRItime, max_age);
1291 }
1292 if (args->deepen_not) {
1293 int i;
1294 for (i = 0; i < args->deepen_not->nr; i++) {
1295 struct string_list_item *s = args->deepen_not->items + i;
1296 packet_buf_write(req_buf, "deepen-not %s", s->string);
1297 }
1298 }
1299 if (args->deepen_relative)
1300 packet_buf_write(req_buf, "deepen-relative\n");
1301}
1302
1303static void add_wants(const struct ref *wants, struct strbuf *req_buf)
1304{

Callers 1

send_fetch_requestFunction · 0.85

Calls 3

is_repository_shallowFunction · 0.85
write_shallow_commitsFunction · 0.85
packet_buf_writeFunction · 0.85

Tested by

no test coverage detected