sha1_file: rename LOOKUP_UNKNOWN_OBJECT
[gitweb.git] / config.c
index 146cb3452adab3115f15d30c2b0f9f5480344279..34a139c40bd57ff2dd23318beca53fd2e2948000 100644 (file)
--- a/config.c
+++ b/config.c
@@ -1438,7 +1438,7 @@ int git_config_from_file(config_fn_t fn, const char *filename, void *data)
        int ret = -1;
        FILE *f;
 
-       f = fopen(filename, "r");
+       f = fopen_or_warn(filename, "r");
        if (f) {
                flockfile(f);
                ret = do_config_from_file(fn, CONFIG_ORIGIN_FILE, filename, filename, f, data);
@@ -2656,6 +2656,9 @@ int git_config_rename_section_in_file(const char *config_filename,
        }
 
        if (!(config_file = fopen(config_filename, "rb"))) {
+               ret = warn_on_fopen_errors(config_filename);
+               if (ret)
+                       goto out;
                /* no config file means nothing to rename, no error */
                goto commit_and_out;
        }