]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/update-index.c
Merge branch 'js/update-index-ignore-removal-for-skip-worktree'
[thirdparty/git.git] / builtin / update-index.c
index 074d563df08570276422bc7bc6311239d2d0d6ee..d527b8f1066859d79d746805c42bb73fab95e78c 100644 (file)
@@ -968,6 +968,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
        struct parse_opt_ctx_t ctx;
        strbuf_getline_fn getline_fn;
        int parseopt_state = PARSE_OPT_UNKNOWN;
+       struct repository *r = the_repository;
        struct option options[] = {
                OPT_BIT('q', NULL, &refresh_args.flags,
                        N_("continue refresh even when index needs update"),
@@ -1184,11 +1185,12 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
                remove_split_index(&the_index);
        }
 
+       prepare_repo_settings(r);
        switch (untracked_cache) {
        case UC_UNSPECIFIED:
                break;
        case UC_DISABLE:
-               if (git_config_get_untracked_cache() == 1)
+               if (r->settings.core_untracked_cache == UNTRACKED_CACHE_WRITE)
                        warning(_("core.untrackedCache is set to true; "
                                  "remove or change it, if you really want to "
                                  "disable the untracked cache"));
@@ -1200,7 +1202,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
                return !test_if_untracked_cache_is_supported();
        case UC_ENABLE:
        case UC_FORCE:
-               if (git_config_get_untracked_cache() == 0)
+               if (r->settings.core_untracked_cache == UNTRACKED_CACHE_REMOVE)
                        warning(_("core.untrackedCache is set to false; "
                                  "remove or change it, if you really want to "
                                  "enable the untracked cache"));