Merge branch 'ms/fetch-prune-configuration'
[gitweb.git] / submodule.c
index 85415d0057402d40c4c9e98e3c94c41eb8dd940f..c0f93c208c11b2dad0d508fcb7adf14873484385 100644 (file)
@@ -134,6 +134,9 @@ int parse_submodule_config_option(const char *var, const char *value)
                return 0;
 
        if (!strcmp(key, "path")) {
+               if (!value)
+                       return config_error_nonbool(var);
+
                config = unsorted_string_list_lookup(&config_name_for_path, value);
                if (config)
                        free(config->util);
@@ -151,6 +154,9 @@ int parse_submodule_config_option(const char *var, const char *value)
        } else if (!strcmp(key, "ignore")) {
                char *name_cstr;
 
+               if (!value)
+                       return config_error_nonbool(var);
+
                if (strcmp(value, "untracked") && strcmp(value, "dirty") &&
                    strcmp(value, "all") && strcmp(value, "none")) {
                        warning("Invalid parameter \"%s\" for config option \"submodule.%s.ignore\"", value, var);
@@ -624,7 +630,7 @@ int fetch_populated_submodules(const struct argv_array *options,
                struct strbuf submodule_path = STRBUF_INIT;
                struct strbuf submodule_git_dir = STRBUF_INIT;
                struct strbuf submodule_prefix = STRBUF_INIT;
-               struct cache_entry *ce = active_cache[i];
+               const struct cache_entry *ce = active_cache[i];
                const char *git_dir, *name, *default_argv;
 
                if (!S_ISGITLINK(ce->ce_mode))