| 1279 | } |
| 1280 | |
| 1281 | static 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 | |
| 1303 | static void add_wants(const struct ref *wants, struct strbuf *req_buf) |
| 1304 | { |
no test coverage detected