sequencer: make the todo_list structure public
[gitweb.git] / config.c
index 646b6cca96b79bd557de18cbd2cc9bdb0c50c6e0..ff521eb27ad243b27c7bd95f3ad7a1b777a4ae00 100644 (file)
--- a/config.c
+++ b/config.c
@@ -1344,14 +1344,6 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
                return 0;
        }
 
-       if (!strcmp(var, "core.hidedotfiles")) {
-               if (value && !strcasecmp(value, "dotgitonly"))
-                       hide_dotfiles = HIDE_DOTFILES_DOTGITONLY;
-               else
-                       hide_dotfiles = git_config_bool(var, value);
-               return 0;
-       }
-
        if (!strcmp(var, "core.partialclonefilter")) {
                return git_config_string(&core_partial_clone_filter_default,
                                         var, value);
@@ -1676,6 +1668,8 @@ static int do_git_config_sequence(const struct config_options *opts,
 
        if (opts->commondir)
                repo_config = mkpathdup("%s/config", opts->commondir);
+       else if (opts->git_dir)
+               BUG("git_dir without commondir");
        else
                repo_config = NULL;
 
@@ -1695,6 +1689,17 @@ static int do_git_config_sequence(const struct config_options *opts,
        if (repo_config && !access_or_die(repo_config, R_OK, 0))
                ret += git_config_from_file(fn, repo_config, data);
 
+       /*
+        * Note: this should have a new scope, CONFIG_SCOPE_WORKTREE.
+        * But let's not complicate things before it's actually needed.
+        */
+       if (repository_format_worktree_config) {
+               char *path = git_pathdup("config.worktree");
+               if (!access_or_die(path, R_OK, 0))
+                       ret += git_config_from_file(fn, path, data);
+               free(path);
+       }
+
        current_parsing_scope = CONFIG_SCOPE_CMDLINE;
        if (git_config_from_parameters(fn, data) < 0)
                die(_("unable to parse command-line config"));
@@ -2289,22 +2294,25 @@ int git_config_get_fsmonitor(void)
        return 0;
 }
 
-int git_config_get_index_threads(void)
+int git_config_get_index_threads(int *dest)
 {
-       int is_bool, val = 0;
+       int is_bool, val;
 
        val = git_env_ulong("GIT_TEST_INDEX_THREADS", 0);
-       if (val)
-               return val;
+       if (val) {
+               *dest = val;
+               return 0;
+       }
 
        if (!git_config_get_bool_or_int("index.threads", &is_bool, &val)) {
                if (is_bool)
-                       return val ? 0 : 1;
+                       *dest = val ? 0 : 1;
                else
-                       return val;
+                       *dest = val;
+               return 0;
        }
 
-       return 0; /* auto */
+       return 1;
 }
 
 NORETURN