X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=config.c;h=70d105567921fe75518d8d5fe3d3df4aad0659cd;hb=b51b8bbf146d17556226bff14f97957e84aa0207;hp=6479855723d6dc94fa7c440868724a794bb59901;hpb=18bdec1118df92649b70ce126aff2f147deecad5;p=git.git diff --git a/config.c b/config.c index 647985572..70d105567 100644 --- a/config.c +++ b/config.c @@ -916,8 +916,8 @@ int git_config_rename_section(const char *old_name, const char *new_name) } if (!(config_file = fopen(config_filename, "rb"))) { - ret = error("Could not open config file!"); - goto out; + /* no config file means nothing to rename, no error */ + goto unlock_and_out; } while (fgets(buf, sizeof(buf), config_file)) { @@ -951,6 +951,7 @@ int git_config_rename_section(const char *old_name, const char *new_name) } } fclose(config_file); + unlock_and_out: if (close(out_fd) || commit_lock_file(lock) < 0) ret = error("Cannot commit config file!"); out: