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

Function read_worktree_config

setup.c:587–602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585}
586
587static int read_worktree_config(const char *var, const char *value,
588 const struct config_context *ctx UNUSED,
589 void *vdata)
590{
591 struct repository_format *data = vdata;
592
593 if (strcmp(var, "core.bare") == 0) {
594 data->is_bare = git_config_bool(var, value);
595 } else if (strcmp(var, "core.worktree") == 0) {
596 if (!value)
597 return config_error_nonbool(var);
598 free(data->work_tree);
599 data->work_tree = xstrdup(value);
600 }
601 return 0;
602}
603
604enum extension_result {
605 EXTENSION_ERROR = -1, /* compatible with error(), etc */

Callers 1

check_repo_formatFunction · 0.85

Calls 3

git_config_boolFunction · 0.85
config_error_nonboolFunction · 0.85
xstrdupFunction · 0.85

Tested by

no test coverage detected