--- v4
+++ v2
@@ -39,14 +39,10 @@
In [4] the "unset" and "keep" handling for core.untrackedCache was
consolidated. But it while we understand the "keep" value, we don't
- handle it differently than the case of any other unknown value.
-
- So let's retain UNTRACKED_CACHE_KEEP and remove the
- UNTRACKED_CACHE_UNSET setting (which was always implicitly
- UNTRACKED_CACHE_KEEP before). We don't need to inform any code
- after prepare_repo_settings() that the setting was "unset", as far
- as anyone else is concerned it's core.untrackedCache=keep. if
- "core.untrackedcache" isn't present in the config.
+ handle it differently than the case of any other unknown value. So
+ we can remove UNTRACKED_CACHE_KEEP. It's not handled any
+ differently than UNTRACKED_CACHE_UNSET once we get past the config
+ parsing step.
* FETCH_NEGOTIATION_UNSET & FETCH_NEGOTIATION_NONE:
@@ -67,47 +63,40 @@
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
- fetch-negotiator.c | 3 --
- read-cache.c | 8 +++-
+ fetch-negotiator.c | 2 -
+ read-cache.c | 2 +-
repo-settings.c | 102 +++++++++++++++++++++++++--------------------
repository.h | 15 +++----
- 4 files changed, 68 insertions(+), 60 deletions(-)
+ 4 files changed, 63 insertions(+), 58 deletions(-)
diff --git a/fetch-negotiator.c b/fetch-negotiator.c
-index e61e40cb299..273390229fe 100644
+index e7b5878be7c..273390229fe 100644
--- a/fetch-negotiator.c
+++ b/fetch-negotiator.c
-@@ -21,8 +21,5 @@ void fetch_negotiator_init(struct repository *r,
+@@ -19,8 +19,6 @@ void fetch_negotiator_init(struct repository *r,
+ return;
+
case FETCH_NEGOTIATION_DEFAULT:
+- case FETCH_NEGOTIATION_UNSET:
+- case FETCH_NEGOTIATION_NONE:
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 e4ae35ccdb2..b0a06db5c55 100644
+index 9dd84d69f00..9bbbbbacabe 100644
--- a/read-cache.c
+++ b/read-cache.c
-@@ -1952,9 +1952,13 @@ static void tweak_untracked_cache(struct index_state *istate)
+@@ -1952,7 +1952,7 @@ static void tweak_untracked_cache(struct index_state *istate)
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.
-+ */
+ case UNTRACKED_CACHE_UNSET:
+- case UNTRACKED_CACHE_KEEP:
++ /* This includes core.untrackedCache=keep */
break;
-- case UNTRACKED_CACHE_UNSET:
-- BUG("UNTRACKED_CACHE_UNSET used outside of prepare_repo_settings()!");
- }
- }
-
+ }
+ return;
diff --git a/repo-settings.c b/repo-settings.c
-index b0df8b93b86..46b9d56aeac 100644
+index b0df8b93b86..6355bc67517 100644
--- a/repo-settings.c
+++ b/repo-settings.c
@@ -3,40 +3,76 @@
@@ -136,7 +125,7 @@
/* Defaults */
- memset(&r->settings, -1, sizeof(r->settings));
+ r->settings.index_version = -1;
-+ r->settings.core_untracked_cache = UNTRACKED_CACHE_KEEP;
++ r->settings.core_untracked_cache = UNTRACKED_CACHE_UNSET;
+ r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_DEFAULT;
+
+ /* Booleans config or default, cascades to other settings */
@@ -199,7 +188,7 @@
+ /*
+ * If it's set to "keep", or some other non-boolean
+ * value then "v < 0". Then we do nothing and keep it
-+ * at the default of UNTRACKED_CACHE_KEEP.
++ * at UNTRACKED_CACHE_UNSET.
+ */
+ if (v >= 0)
+ r->settings.core_untracked_cache = v ?
@@ -243,7 +232,7 @@
* This setting guards all index reads to require a full index
* over a sparse index. After suitable guards are placed in the
diff --git a/repository.h b/repository.h
-index 3740c93bc0f..bf36744e0a7 100644
+index 3740c93bc0f..c03fe8da8d0 100644
--- a/repository.h
+++ b/repository.h
@@ -13,18 +13,15 @@ struct submodule_cache;
@@ -254,7 +243,7 @@
- UNTRACKED_CACHE_REMOVE = 0,
- UNTRACKED_CACHE_KEEP = 1,
- UNTRACKED_CACHE_WRITE = 2
-+ UNTRACKED_CACHE_KEEP,
++ UNTRACKED_CACHE_UNSET,
+ UNTRACKED_CACHE_REMOVE,
+ UNTRACKED_CACHE_WRITE,
};
@@ -272,5 +261,5 @@
struct repo_settings {
--
-2.33.0.1098.gf02a64c1a2d
-
+2.33.0.1092.g44c994ea1be
+