MCPcopy Create free account
hub / github.com/git/git / fill_alternate_refs_command

Function fill_alternate_refs_command

odb.c:371–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371static 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
399static void read_alternate_refs(struct repository *repo,
400 const char *path,

Callers 1

read_alternate_refsFunction · 0.85

Calls 5

repo_config_get_valueFunction · 0.85
strvec_pushFunction · 0.85
strvec_pushfFunction · 0.85
strvec_splitFunction · 0.85
strvec_pushvFunction · 0.85

Tested by

no test coverage detected