| 295 | } |
| 296 | |
| 297 | static int include_by_branch(struct config_include_data *data, |
| 298 | const char *cond, size_t cond_len) |
| 299 | { |
| 300 | int flags; |
| 301 | int ret; |
| 302 | struct strbuf pattern = STRBUF_INIT; |
| 303 | const char *refname, *shortname; |
| 304 | |
| 305 | if (!data->repo || data->repo->ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN) |
| 306 | return 0; |
| 307 | |
| 308 | refname = refs_resolve_ref_unsafe(get_main_ref_store(data->repo), |
| 309 | "HEAD", 0, NULL, &flags); |
| 310 | if (!refname || |
| 311 | !(flags & REF_ISSYMREF) || |
| 312 | !skip_prefix(refname, "refs/heads/", &shortname)) |
| 313 | return 0; |
| 314 | |
| 315 | strbuf_add(&pattern, cond, cond_len); |
| 316 | add_trailing_starstar_for_dir(&pattern); |
| 317 | ret = !wildmatch(pattern.buf, shortname, WM_PATHNAME); |
| 318 | strbuf_release(&pattern); |
| 319 | return ret; |
| 320 | } |
| 321 | |
| 322 | static int add_remote_url(const char *var, const char *value, |
| 323 | const struct config_context *ctx UNUSED, void *data) |
no test coverage detected