| 369 | } |
| 370 | |
| 371 | static void fill_alternate_refs_command(struct repository *repo, |
| 372 | struct child_process *cmd, |
| 373 | const char *repo_path) |
| 374 | { |
| 375 | const char *value; |
| 376 | |
| 377 | if (!repo_config_get_value(repo, "core.alternateRefsCommand", &value)) { |
| 378 | cmd->use_shell = 1; |
| 379 | |
| 380 | strvec_push(&cmd->args, value); |
| 381 | strvec_push(&cmd->args, repo_path); |
| 382 | } else { |
| 383 | cmd->git_cmd = 1; |
| 384 | |
| 385 | strvec_pushf(&cmd->args, "--git-dir=%s", repo_path); |
| 386 | strvec_push(&cmd->args, "for-each-ref"); |
| 387 | strvec_push(&cmd->args, "--format=%(objectname)"); |
| 388 | |
| 389 | if (!repo_config_get_value(repo, "core.alternateRefsPrefixes", &value)) { |
| 390 | strvec_push(&cmd->args, "--"); |
| 391 | strvec_split(&cmd->args, value); |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | strvec_pushv(&cmd->env, (const char **)local_repo_env); |
| 396 | cmd->out = -1; |
| 397 | } |
| 398 | |
| 399 | static void read_alternate_refs(struct repository *repo, |
| 400 | const char *path, |
no test coverage detected