diff options
author | Lessley Dennington <lessleydennington@gmail.com> | 2021-12-06 15:55:57 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-06 17:55:05 (GMT) |
commit | 27a443b8208b802a9856819d79175976f9a9b993 (patch) | |
tree | 1fb91c88c94bf2daa268df367b19733db7441603 | |
parent | 0803f9c7cdff63d0c6cb992ba90f53fdcae50869 (diff) | |
download | git-27a443b8208b802a9856819d79175976f9a9b993.zip git-27a443b8208b802a9856819d79175976f9a9b993.tar.gz git-27a443b8208b802a9856819d79175976f9a9b993.tar.bz2 |
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 <lessleydennington@gmail.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | t/helper/test-read-cache.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/t/helper/test-read-cache.c b/t/helper/test-read-cache.c index b52c174..0d9f089 100644 --- a/t/helper/test-read-cache.c +++ b/t/helper/test-read-cache.c @@ -39,8 +39,6 @@ int cmd__read_cache(int argc, const char **argv) int table = 0, expand = 0; initialize_the_repository(); - prepare_repo_settings(r); - r->settings.command_requires_full_index = 0; for (++argv, --argc; *argv && starts_with(*argv, "--"); ++argv, --argc) { if (skip_prefix(*argv, "--print-and-refresh=", &name)) @@ -56,6 +54,9 @@ int cmd__read_cache(int argc, const char **argv) setup_git_directory(); git_config(git_default_config, NULL); + prepare_repo_settings(r); + r->settings.command_requires_full_index = 0; + for (i = 0; i < cnt; i++) { repo_read_index(r); |