Skip to content

Commit

Permalink
fixup! survey: stub in new experimental git-survey command
Browse files Browse the repository at this point in the history
The `-h` option prevents `prepare_repo_settings()` from working,
therefore the options need to be parsed _before_ calling that function.
Otherwise the user will be greeted with:

  BUG: repo-settings.c:31: Cannot add settings for uninitialized repository

This fixes t0012.155 (run `cd t && sh t0012-*.sh -ivx --run=32,155` to
see this error message written to the `output` file in the trash
directory).

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Jul 1, 2024
1 parent 5ae1d0c commit 45c981e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtin/survey.c
Original file line number Diff line number Diff line change
Expand Up @@ -2262,7 +2262,6 @@ static void survey_print_results_pretty(void)

int cmd_survey(int argc, const char **argv, const char *prefix)
{
prepare_repo_settings(the_repository);
survey_load_config();

argc = parse_options(argc, argv, prefix, survey_options, survey_usage, 0);
Expand All @@ -2271,6 +2270,8 @@ int cmd_survey(int argc, const char **argv, const char *prefix)
want_color_fd(2, GIT_COLOR_AUTO) ? GIT_COLOR_YELLOW : "",
"(THIS IS EXPERIMENTAL, EXPECT THE OUTPUT FORMAT TO CHANGE!)");

prepare_repo_settings(the_repository);

if (survey_opts.show_progress < 0)
survey_opts.show_progress = isatty(2);
fixup_refs_wanted();
Expand Down

0 comments on commit 45c981e

Please sign in to comment.