Skip to content

Commit 1fde1c5

Browse files
ayu-chgitster
authored andcommitted
preload-index: stop depending on 'the_repository'
Refactor "preload-index.c" to remove the dependency on the global 'the_repository'. Replace the occurrences of 'the_repository' with 'index->repo' and thus remove the definition '#define USE_THE_REPOSITORY_VARIABLE'. Mentored-by: Christian Couder <[email protected]> Mentored-by: Ghanshyam Thakkar <[email protected]> Signed-off-by: Ayush Chandekar <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b1d47b4 commit 1fde1c5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

preload-index.c

Lines changed: 2 additions & 3 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"
@@ -114,7 +113,7 @@ void preload_index(struct index_state *index,
114113
int t2_sum_lstat = 0;
115114
int core_preload_index = 1;
116115

117-
repo_config_get_bool(the_repository, "core.preloadindex", &core_preload_index);
116+
repo_config_get_bool(index->repo, "core.preloadindex", &core_preload_index);
118117

119118
if (!HAVE_THREADS || !core_preload_index)
120119
return;
@@ -136,7 +135,7 @@ void preload_index(struct index_state *index,
136135

137136
memset(&pd, 0, sizeof(pd));
138137
if (refresh_flags & REFRESH_PROGRESS && isatty(2)) {
139-
pd.progress = start_delayed_progress(the_repository,
138+
pd.progress = start_delayed_progress(index->repo,
140139
_("Refreshing index"),
141140
index->cache_nr);
142141
pthread_mutex_init(&pd.mutex, NULL);

0 commit comments

Comments
 (0)