Skip to content

Commit 54cfb01

Browse files
committed
Merge branch 'ac/preload-index-wo-the-repository' into jch
* ac/preload-index-wo-the-repository: preload-index: stop depending on 'the_repository' environment: remove the global variable 'core_preload_index'
2 parents 9ce2144 + 1fde1c5 commit 54cfb01

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

config.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,11 +1595,6 @@ static int git_default_core_config(const char *var, const char *value,
15951595
return 0;
15961596
}
15971597

1598-
if (!strcmp(var, "core.preloadindex")) {
1599-
core_preload_index = git_config_bool(var, value);
1600-
return 0;
1601-
}
1602-
16031598
if (!strcmp(var, "core.createobject")) {
16041599
if (!value)
16051600
return config_error_nonbool(var);

environment.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ const char *comment_line_str = "#";
113113
char *comment_line_str_to_free;
114114
int auto_comment_line_char;
115115

116-
/* Parallel index stat data preload? */
117-
int core_preload_index = 1;
118-
119116
/* This is set by setup_git_directory_gently() and/or git_default_config() */
120117
char *git_work_tree_cfg;
121118

environment.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ extern int pack_compression_level;
155155
extern unsigned long pack_size_limit_cfg;
156156
extern int max_allowed_tree_depth;
157157

158-
extern int core_preload_index;
159158
extern int precomposed_unicode;
160159
extern int protect_hfs;
161160
extern int protect_ntfs;

preload-index.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Copyright (C) 2008 Linus Torvalds
33
*/
44

5-
#define USE_THE_REPOSITORY_VARIABLE
65
#define DISABLE_SIGN_COMPARE_WARNINGS
76

87
#include "git-compat-util.h"
@@ -19,6 +18,7 @@
1918
#include "repository.h"
2019
#include "symlinks.h"
2120
#include "trace2.h"
21+
#include "config.h"
2222

2323
/*
2424
* Mostly randomly chosen maximum thread counts: we
@@ -111,6 +111,9 @@ void preload_index(struct index_state *index,
111111
struct thread_data data[MAX_PARALLEL];
112112
struct progress_data pd;
113113
int t2_sum_lstat = 0;
114+
int core_preload_index = 1;
115+
116+
repo_config_get_bool(index->repo, "core.preloadindex", &core_preload_index);
114117

115118
if (!HAVE_THREADS || !core_preload_index)
116119
return;
@@ -132,7 +135,7 @@ void preload_index(struct index_state *index,
132135

133136
memset(&pd, 0, sizeof(pd));
134137
if (refresh_flags & REFRESH_PROGRESS && isatty(2)) {
135-
pd.progress = start_delayed_progress(the_repository,
138+
pd.progress = start_delayed_progress(index->repo,
136139
_("Refreshing index"),
137140
index->cache_nr);
138141
pthread_mutex_init(&pd.mutex, NULL);

0 commit comments

Comments
 (0)