static int check_repo_format(const char *var, const char *value, void *cb) { if (strcmp(var, "core.repositoryformatversion") == 0) repository_format_version = git_config_int(var, value); else if (strcmp(var, "core.sharedrepository") == 0) shared_repository = git_config_perm(var, value); return 0; }
int check_repository_format_version(const char *var, const char *value, void *cb) { if (strcmp(var, "core.repositoryformatversion") == 0) repository_format_version = git_config_int(var, value); else if (strcmp(var, "core.sharedrepository") == 0) shared_repository = git_config_perm(var, value); else if (strcmp(var, "core.bare") == 0) { is_bare_repository_cfg = git_config_bool(var, value); if (is_bare_repository_cfg == 1) inside_work_tree = -1; } else if (strcmp(var, "core.worktree") == 0) { if (!value) return config_error_nonbool(var); free(git_work_tree_cfg); git_work_tree_cfg = xstrdup(value); inside_work_tree = -1; } return 0; }
static int check_repo_format(const char *var, const char *value, void *cb) { const char *ext; if (strcmp(var, "core.repositoryformatversion") == 0) repository_format_version = git_config_int(var, value); else if (strcmp(var, "core.sharedrepository") == 0) shared_repository = git_config_perm(var, value); else if (skip_prefix(var, "extensions.", &ext)) { /* * record any known extensions here; otherwise, * we fall through to recording it as unknown, and * check_repository_format will complain */ if (!strcmp(ext, "noop")) ; else if (!strcmp(ext, "preciousobjects")) repository_format_precious_objects = git_config_bool(var, value); else string_list_append(&unknown_extensions, ext); } return 0; }
static int shared_callback(const struct option *opt, const char *arg, int unset) { BUG_ON_OPT_NEG(unset); *((int *) opt->value) = (arg) ? git_config_perm("arg", arg) : PERM_GROUP; return 0; }