| 331 | } |
| 332 | |
| 333 | static int reftable_be_config(const char *var, const char *value, |
| 334 | const struct config_context *ctx, |
| 335 | void *_opts) |
| 336 | { |
| 337 | struct reftable_write_options *opts = _opts; |
| 338 | |
| 339 | if (!strcmp(var, "reftable.blocksize")) { |
| 340 | unsigned long block_size = git_config_ulong(var, value, ctx->kvi); |
| 341 | if (block_size > 16777215) |
| 342 | die("reftable block size cannot exceed 16MB"); |
| 343 | opts->block_size = block_size; |
| 344 | } else if (!strcmp(var, "reftable.restartinterval")) { |
| 345 | unsigned long restart_interval = git_config_ulong(var, value, ctx->kvi); |
| 346 | if (restart_interval > UINT16_MAX) |
| 347 | die("reftable block size cannot exceed %u", (unsigned)UINT16_MAX); |
| 348 | opts->restart_interval = restart_interval; |
| 349 | } else if (!strcmp(var, "reftable.indexobjects")) { |
| 350 | opts->skip_index_objects = !git_config_bool(var, value); |
| 351 | } else if (!strcmp(var, "reftable.geometricfactor")) { |
| 352 | unsigned long factor = git_config_ulong(var, value, ctx->kvi); |
| 353 | if (factor > UINT8_MAX) |
| 354 | die("reftable geometric factor cannot exceed %u", (unsigned)UINT8_MAX); |
| 355 | opts->auto_compaction_factor = factor; |
| 356 | } else if (!strcmp(var, "reftable.locktimeout")) { |
| 357 | int64_t lock_timeout = git_config_int64(var, value, ctx->kvi); |
| 358 | if (lock_timeout > LONG_MAX) |
| 359 | die("reftable lock timeout cannot exceed %"PRIdMAX, (intmax_t)LONG_MAX); |
| 360 | if (lock_timeout < 0 && lock_timeout != -1) |
| 361 | die("reftable lock timeout does not support negative values other than -1"); |
| 362 | opts->lock_timeout_ms = lock_timeout; |
| 363 | } |
| 364 | |
| 365 | return 0; |
| 366 | } |
| 367 | |
| 368 | static struct ref_store *reftable_be_init(struct repository *repo, |
| 369 | const char *payload, |
nothing calls this directly
no test coverage detected