| 1259 | } |
| 1260 | |
| 1261 | static 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 | |
| 1286 | out: |
| 1287 | location_options_release(&location_opts); |
| 1288 | return ret; |
| 1289 | } |
| 1290 | |
| 1291 | static int show_editor(struct config_location_options *opts) |
| 1292 | { |
nothing calls this directly
no test coverage detected