Merge branch 'ab/repo-settings-cleanup'

Code cleanup.

* ab/repo-settings-cleanup:
  repository.h: don't use a mix of int and bitfields
  repo-settings.c: simplify the setup
  read-cache & fetch-negotiator: check "enum" values in switch()
  environment.c: remove test-specific "ignore_untracked..." variable
  wrapper.c: add x{un,}setenv(), and use xsetenv() in environment.c
This commit is contained in:
Junio C Hamano
2021-10-06 13:40:11 -07:00
9 changed files with 98 additions and 94 deletions

View File

@ -1944,13 +1944,22 @@ static void tweak_untracked_cache(struct index_state *istate)
prepare_repo_settings(r);
if (r->settings.core_untracked_cache == UNTRACKED_CACHE_REMOVE) {
switch (r->settings.core_untracked_cache) {
case UNTRACKED_CACHE_REMOVE:
remove_untracked_cache(istate);
return;
}
if (r->settings.core_untracked_cache == UNTRACKED_CACHE_WRITE)
break;
case UNTRACKED_CACHE_WRITE:
add_untracked_cache(istate);
break;
case UNTRACKED_CACHE_KEEP:
/*
* Either an explicit "core.untrackedCache=keep", the
* default if "core.untrackedCache" isn't configured,
* or a fallback on an unknown "core.untrackedCache"
* value.
*/
break;
}
}
static void tweak_split_index(struct index_state *istate)