| 394 | } |
| 395 | |
| 396 | static int include_condition_is_true(const struct key_value_info *kvi, |
| 397 | struct config_include_data *inc, |
| 398 | const char *cond, size_t cond_len) |
| 399 | { |
| 400 | const struct config_options *opts = inc->opts; |
| 401 | |
| 402 | if (skip_prefix_mem(cond, cond_len, "gitdir:", &cond, &cond_len)) |
| 403 | return include_by_gitdir(kvi, opts, cond, cond_len, 0); |
| 404 | else if (skip_prefix_mem(cond, cond_len, "gitdir/i:", &cond, &cond_len)) |
| 405 | return include_by_gitdir(kvi, opts, cond, cond_len, 1); |
| 406 | else if (skip_prefix_mem(cond, cond_len, "onbranch:", &cond, &cond_len)) |
| 407 | return include_by_branch(inc, cond, cond_len); |
| 408 | else if (skip_prefix_mem(cond, cond_len, "hasconfig:remote.*.url:", &cond, |
| 409 | &cond_len)) |
| 410 | return include_by_remote_url(inc, cond, cond_len); |
| 411 | |
| 412 | /* unknown conditionals are always false */ |
| 413 | return 0; |
| 414 | } |
| 415 | |
| 416 | static int git_config_include(const char *var, const char *value, |
| 417 | const struct config_context *ctx, |
no test coverage detected