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

Function cmd_config_remove_section

builtin/config.c:1261–1289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1259}
1260
1261static int cmd_config_remove_section(int argc, const char **argv, const char *prefix,
1262 struct repository *repo UNUSED)
1263{
1264 struct config_location_options location_opts = CONFIG_LOCATION_OPTIONS_INIT;
1265 struct option opts[] = {
1266 CONFIG_LOCATION_OPTIONS(location_opts),
1267 OPT_END(),
1268 };
1269 int ret;
1270
1271 argc = parse_options(argc, argv, prefix, opts, builtin_config_remove_section_usage,
1272 PARSE_OPT_STOP_AT_NON_OPTION);
1273 check_argc(argc, 1, 1);
1274
1275 location_options_init(&location_opts, prefix);
1276 check_write(&location_opts.source);
1277
1278 ret = repo_config_rename_section_in_file(the_repository, location_opts.source.file,
1279 argv[0], NULL);
1280 if (ret < 0)
1281 goto out;
1282 else if (!ret)
1283 die(_("no such section: %s"), argv[0]);
1284 ret = 0;
1285
1286out:
1287 location_options_release(&location_opts);
1288 return ret;
1289}
1290
1291static int show_editor(struct config_location_options *opts)
1292{

Callers

nothing calls this directly

Calls 7

parse_optionsFunction · 0.85
check_argcFunction · 0.85
location_options_initFunction · 0.85
check_writeFunction · 0.85
location_options_releaseFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected