Merge branch 'tg/push-all-in-mirror-forbidden'
[gitweb.git] / builtin / update-index.c
index dff2f4b837208deebeb34f4af687c18df7dbfe76..49302d98c55d19651cacef7b36197de65d805e50 100644 (file)
@@ -966,6 +966,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"),
@@ -1180,11 +1181,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"));
@@ -1196,7 +1198,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"));