| 1939 | } |
| 1940 | |
| 1941 | static bool gf_batch_command(gf_batch_work_t *work, size_t first, size_t count, bool payload, |
| 1942 | cbm_git_facts_error_t *error) { |
| 1943 | const char *args[] = {"cat-file", |
| 1944 | payload ? "--batch=%(objectname) %(objecttype) %(objectsize)" |
| 1945 | : "--batch-check=%(objectname) %(objecttype) %(objectsize)"}; |
| 1946 | cbm_git_bytes_t input = {work->lines + first * work->line_length, count * work->line_length}; |
| 1947 | gf_result_t result; |
| 1948 | if (!gf_run_input(work->facts, args, 2, false, &input, &result, error)) |
| 1949 | return false; |
| 1950 | gf_batch_frames_t frames = {.width = work->facts->identity.oid_hex_length, |
| 1951 | .count = count, |
| 1952 | .objects = work->objects + first, |
| 1953 | .has_payload = payload}; |
| 1954 | return gf_batch_capture(work->facts, result.out, &frames, error); |
| 1955 | } |
| 1956 | |
| 1957 | static bool gf_batch_preflight(gf_batch_work_t *work, cbm_git_facts_error_t *error) { |
| 1958 | size_t worst_header = work->facts->identity.oid_hex_length + 7 + gf_batch_digits(SIZE_MAX); |
no test coverage detected