diff options
-rw-r--r-- | fetch-negotiator.c | 4 | ||||
-rw-r--r-- | read-cache.c | 15 |
2 files changed, 13 insertions, 6 deletions
diff --git a/fetch-negotiator.c b/fetch-negotiator.c index 57ed5784e1..e61e40cb29 100644 --- a/fetch-negotiator.c +++ b/fetch-negotiator.c @@ -19,8 +19,10 @@ void fetch_negotiator_init(struct repository *r, return; case FETCH_NEGOTIATION_DEFAULT: - default: default_negotiator_init(negotiator); return; + case FETCH_NEGOTIATION_NONE: + case FETCH_NEGOTIATION_UNSET: + BUG("FETCH_NEGOTIATION_{NONE,UNSET} used outside of prepare_repo_settings()!"); } } diff --git a/read-cache.c b/read-cache.c index 9048ef9e90..4892813833 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1944,13 +1944,18 @@ 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: + break; + case UNTRACKED_CACHE_UNSET: + BUG("UNTRACKED_CACHE_UNSET used outside of prepare_repo_settings()!"); + } } static void tweak_split_index(struct index_state *istate) |