]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/commit.c
advice: remove read uses of most global `advice_` variables
[thirdparty/git.git] / builtin / commit.c
index cfbc83751a5f3fadaecd9bd512f85854b888398e..df8bcc27ae968018b59ffdabe4080089327b10c7 100644 (file)
@@ -203,7 +203,7 @@ static void status_init_config(struct wt_status *s, config_fn_t fn)
        init_diff_ui_defaults();
        git_config(fn, s);
        determine_whence(s);
-       s->hints = advice_status_hints; /* must come after git_config() */
+       s->hints = advice_enabled(ADVICE_STATUS_HINTS); /* must come after git_config() */
 }
 
 static void rollback_index_files(void)
@@ -1033,7 +1033,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
         */
        if (!committable && whence != FROM_MERGE && !allow_empty &&
            !(amend && is_a_merge(current_head))) {
-               s->hints = advice_status_hints;
+               s->hints = advice_enabled(ADVICE_STATUS_HINTS);
                s->display_comment_prefix = old_display_comment_prefix;
                run_status(stdout, index_file, prefix, 0, s);
                if (amend)
@@ -1517,6 +1517,9 @@ int cmd_status(int argc, const char **argv, const char *prefix)
        if (argc == 2 && !strcmp(argv[1], "-h"))
                usage_with_options(builtin_status_usage, builtin_status_options);
 
+       prepare_repo_settings(the_repository);
+       the_repository->settings.command_requires_full_index = 0;
+
        status_init_config(&s, git_status_config);
        argc = parse_options(argc, argv, prefix,
                             builtin_status_options,
@@ -1686,6 +1689,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
        if (argc == 2 && !strcmp(argv[1], "-h"))
                usage_with_options(builtin_commit_usage, builtin_commit_options);
 
+       prepare_repo_settings(the_repository);
+       the_repository->settings.command_requires_full_index = 0;
+
        status_init_config(&s, git_commit_config);
        s.commit_template = 1;
        status_format = STATUS_FORMAT_NONE; /* Ignore status.short */