Skip to content

Commit 27a443b

Browse files
ldenningtongitster
authored andcommitted
test-read-cache: set up repo after git directory
Move repo setup to occur after git directory is set up. This will protect against test failures in the upcoming change to BUG in prepare_repo_settings if no git directory exists. Signed-off-by: Lessley Dennington <[email protected]> Reviewed-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0803f9c commit 27a443b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

t/helper/test-read-cache.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ int cmd__read_cache(int argc, const char **argv)
3939
int table = 0, expand = 0;
4040

4141
initialize_the_repository();
42-
prepare_repo_settings(r);
43-
r->settings.command_requires_full_index = 0;
4442

4543
for (++argv, --argc; *argv && starts_with(*argv, "--"); ++argv, --argc) {
4644
if (skip_prefix(*argv, "--print-and-refresh=", &name))
@@ -56,6 +54,9 @@ int cmd__read_cache(int argc, const char **argv)
5654
setup_git_directory();
5755
git_config(git_default_config, NULL);
5856

57+
prepare_repo_settings(r);
58+
r->settings.command_requires_full_index = 0;
59+
5960
for (i = 0; i < cnt; i++) {
6061
repo_read_index(r);
6162

0 commit comments

Comments
 (0)