Git fork

Merge branch 'ac/preload-index-wo-the-repository'

Code clean-up.

* ac/preload-index-wo-the-repository:
preload-index: stop depending on 'the_repository'
environment: remove the global variable 'core_preload_index'

+5 -11
-5
config.c
··· 1595 1595 return 0; 1596 1596 } 1597 1597 1598 - if (!strcmp(var, "core.preloadindex")) { 1599 - core_preload_index = git_config_bool(var, value); 1600 - return 0; 1601 - } 1602 - 1603 1598 if (!strcmp(var, "core.createobject")) { 1604 1599 if (!value) 1605 1600 return config_error_nonbool(var);
-3
environment.c
··· 113 113 char *comment_line_str_to_free; 114 114 int auto_comment_line_char; 115 115 116 - /* Parallel index stat data preload? */ 117 - int core_preload_index = 1; 118 - 119 116 /* This is set by setup_git_directory_gently() and/or git_default_config() */ 120 117 char *git_work_tree_cfg; 121 118
-1
environment.h
··· 155 155 extern unsigned long pack_size_limit_cfg; 156 156 extern int max_allowed_tree_depth; 157 157 158 - extern int core_preload_index; 159 158 extern int precomposed_unicode; 160 159 extern int protect_hfs; 161 160 extern int protect_ntfs;
+5 -2
preload-index.c
··· 2 2 * Copyright (C) 2008 Linus Torvalds 3 3 */ 4 4 5 - #define USE_THE_REPOSITORY_VARIABLE 6 5 #define DISABLE_SIGN_COMPARE_WARNINGS 7 6 8 7 #include "git-compat-util.h" ··· 19 18 #include "repository.h" 20 19 #include "symlinks.h" 21 20 #include "trace2.h" 21 + #include "config.h" 22 22 23 23 /* 24 24 * Mostly randomly chosen maximum thread counts: we ··· 111 111 struct thread_data data[MAX_PARALLEL]; 112 112 struct progress_data pd; 113 113 int t2_sum_lstat = 0; 114 + int core_preload_index = 1; 115 + 116 + repo_config_get_bool(index->repo, "core.preloadindex", &core_preload_index); 114 117 115 118 if (!HAVE_THREADS || !core_preload_index) 116 119 return; ··· 132 135 133 136 memset(&pd, 0, sizeof(pd)); 134 137 if (refresh_flags & REFRESH_PROGRESS && isatty(2)) { 135 - pd.progress = start_delayed_progress(the_repository, 138 + pd.progress = start_delayed_progress(index->repo, 136 139 _("Refreshing index"), 137 140 index->cache_nr); 138 141 pthread_mutex_init(&pd.mutex, NULL);