if (!result) {
strbuf_addf(&buf, "remote.%s", remote->name);
- if (git_config_rename_section(buf.buf, NULL) < 1) {
- if (repo_config_rename_section(the_repository, buf.buf, NULL) < 1)
- return error(_("Could not remove config section '%s'"), buf.buf);
++ if (repo_config_rename_section(the_repository, buf.buf, NULL) < 1) {
+ result = error(_("Could not remove config section '%s'"), buf.buf);
+ goto out;
+ }
handle_push_default(remote->name, NULL);
}