git.txt: remove empty line before list continuation
[gitweb.git] / config.c
index 2ffd39c22006beaf8c4b0941d82183dd3b756955..24ad1a985400168e33778781d01d6e9e6c6ededf 100644 (file)
--- a/config.c
+++ b/config.c
@@ -1668,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;
 
@@ -2292,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
@@ -2560,7 +2565,6 @@ static ssize_t write_pair(int fd, const char *key, const char *value,
  * entry (which all are to be removed).
  */
 static void maybe_remove_section(struct config_store_data *store,
-                                const char *contents,
                                 size_t *begin_offset, size_t *end_offset,
                                 int *seen_ptr)
 {
@@ -2845,7 +2849,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
                                replace_end = store.parsed[j].end;
                                copy_end = store.parsed[j].begin;
                                if (!value)
-                                       maybe_remove_section(&store, contents,
+                                       maybe_remove_section(&store,
                                                             &copy_end,
                                                             &replace_end, &i);
                                /*