Merge branch 'mm/rebase-continue-freebsd-WB' into maint
[gitweb.git] / submodule.c
index 1821a5b3160bd3a3e60f328b50b56a0208b2df9c..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);
@@ -226,6 +232,7 @@ static void print_submodule_summary(struct rev_info *rev, FILE *f,
        while ((commit = get_revision(rev))) {
                struct pretty_print_context ctx = {0};
                ctx.date_mode = rev->date_mode;
+               ctx.output_encoding = get_log_output_encoding();
                strbuf_setlen(&sb, 0);
                strbuf_addstr(&sb, line_prefix);
                if (commit->object.flags & SYMMETRIC_LEFT) {
@@ -623,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))
@@ -845,7 +852,7 @@ static int find_first_merges(struct object_array *result, const char *path,
                struct commit *a, struct commit *b)
 {
        int i, j;
-       struct object_array merges;
+       struct object_array merges = OBJECT_ARRAY_INIT;
        struct commit *commit;
        int contains_another;
 
@@ -855,7 +862,6 @@ static int find_first_merges(struct object_array *result, const char *path,
        struct rev_info revs;
        struct setup_revision_opt rev_opts;
 
-       memset(&merges, 0, sizeof(merges));
        memset(result, 0, sizeof(struct object_array));
        memset(&rev_opts, 0, sizeof(rev_opts));
 
@@ -893,8 +899,7 @@ static int find_first_merges(struct object_array *result, const char *path,
                }
 
                if (!contains_another)
-                       add_object_array(merges.objects[i].item,
-                                        merges.objects[i].name, result);
+                       add_object_array(merges.objects[i].item, NULL, result);
        }
 
        free(merges.objects);