The gitoxide specific variable wasn't needed in the first place.
Unified · Split
| @@ -426,10 +426,6 @@ fn apply_environment_overrides( · 425 unmodified lines | ||
| 426 | 426 | Some(Cow::Borrowed("objects".into())), |
| 427 | 427 | objects, |
| 428 | 428 | &[ |
| 429 | − { | |
| 430 | − let key = &gitoxide::Objects::NO_REPLACE; | |
| 431 | − (env(key), key.name) | |
| 432 | − }, | |
| 433 | 429 | { |
| 434 | 430 | let key = &gitoxide::Objects::REPLACE_REF_BASE; |
| 435 | 431 | (env(key), key.name) |
| @@ -491,6 +487,10 @@ fn apply_environment_overrides( · 55 unmodified lines | ||
| 491 | 487 | let key = &Core::SSH_COMMAND; |
| 492 | 488 | (env(key), key.name, git_prefix) |
| 493 | 489 | }, |
| 490 | + { | |
| 491 | + let key = &Core::USE_REPLACE_REFS; | |
| 492 | + (env(key), key.name, objects) | |
| 493 | + }, | |
| 494 | 494 | ] { |
| 495 | 495 | if let Some(value) = var_as_bstring(var, permission) { |
| 496 | 496 | section.push_with_comment( |
| @@ -63,6 +63,9 @@ impl Core { · 62 unmodified lines | ||
| 63 | 63 | /// The `core.sshCommand` key. |
| 64 | 64 | pub const SSH_COMMAND: keys::Executable = keys::Executable::new_executable("sshCommand", &config::Tree::CORE) |
| 65 | 65 | .with_environment_override("GIT_SSH_COMMAND"); |
| 66 | + /// The `core.useReplaceRefs` key. | |
| 67 | + pub const USE_REPLACE_REFS: keys::Boolean = keys::Boolean::new_boolean("useReplaceRefs", &config::Tree::CORE) | |
| 68 | + .with_environment_override("GIT_NO_REPLACE_OBJECTS"); | |
| 66 | 69 | } |
| 67 | 70 | |
| 68 | 71 | impl Section for Core { |
| @@ -92,6 +95,7 @@ impl Section for Core { · 23 unmodified lines | ||
| 92 | 95 | &Self::EXCLUDES_FILE, |
| 93 | 96 | &Self::ATTRIBUTES_FILE, |
| 94 | 97 | &Self::SSH_COMMAND, |
| 98 | + &Self::USE_REPLACE_REFS, | |
| 95 | 99 | ] |
| 96 | 100 | } |
| 97 | 101 | } |
| @@ -317,8 +317,7 @@ mod subsections { · 316 unmodified lines | ||
| 317 | 317 | .with_note("If unset or 0, there is no object cache") |
| 318 | 318 | .with_environment_override("GITOXIDE_OBJECT_CACHE_MEMORY"); |
| 319 | 319 | /// The `gitoxide.objects.noReplace` key. |
| 320 | − pub const NO_REPLACE: keys::Boolean = keys::Boolean::new_boolean("noReplace", &Gitoxide::OBJECTS) | |
| 321 | − .with_environment_override("GIT_NO_REPLACE_OBJECTS"); | |
| 320 | + pub const NO_REPLACE: keys::Boolean = keys::Boolean::new_boolean("noReplace", &Gitoxide::OBJECTS); | |
| 322 | 321 | /// The `gitoxide.objects.replaceRefBase` key. |
| 323 | 322 | pub const REPLACE_REF_BASE: keys::Any = |
| 324 | 323 | keys::Any::new("replaceRefBase", &Gitoxide::OBJECTS).with_environment_override("GIT_REPLACE_REF_BASE"); |
| @@ -330,7 +329,7 @@ mod subsections { · 5 unmodified lines | ||
| 330 | 329 | } |
| 331 | 330 | |
| 332 | 331 | fn keys(&self) -> &[&dyn Key] { |
| 333 | − &[&Self::CACHE_LIMIT, &Self::NO_REPLACE, &Self::REPLACE_REF_BASE] | |
| 332 | + &[&Self::CACHE_LIMIT, &Self::REPLACE_REF_BASE] | |
| 334 | 333 | } |
| 335 | 334 | |
| 336 | 335 | fn parent(&self) -> Option<&dyn Section> { |
| @@ -284,12 +284,12 @@ fn replacement_objects_refs_prefix( · 283 unmodified lines | ||
| 284 | 284 | mut filter_config_section: fn(&gix_config::file::Metadata) -> bool, |
| 285 | 285 | ) -> Result<Option<PathBuf>, Error> { |
| 286 | 286 | let is_disabled = config |
| 287 | − .boolean_filter_by_key("gitoxide.objects.noReplace", &mut filter_config_section) | |
| 288 | − .map(|b| gitoxide::Objects::NO_REPLACE.enrich_error(b)) | |
| 287 | + .boolean_filter_by_key("core.useReplaceRefs", &mut filter_config_section) | |
| 288 | + .map(|b| Core::USE_REPLACE_REFS.enrich_error(b)) | |
| 289 | 289 | .transpose() |
| 290 | 290 | .with_leniency(lenient) |
| 291 | 291 | .map_err(config::Error::ConfigBoolean)? |
| 292 | − .unwrap_or_default(); | |
| 292 | + .unwrap_or(true); | |
| 293 | 293 | |
| 294 | 294 | if is_disabled { |
| 295 | 295 | return Ok(None); |
| @@ -394,7 +394,7 @@ mod with_overrides { · 393 unmodified lines | ||
| 394 | 394 | for (key, expected) in [ |
| 395 | 395 | ("gitoxide.http.verbose", "true"), |
| 396 | 396 | ("gitoxide.allow.protocolFromUser", "file-allowed"), |
| 397 | − ("gitoxide.objects.noReplace", "no-replace"), | |
| 397 | + ("core.useReplaceRefs", "no-replace"), | |
| 398 | 398 | ("gitoxide.objects.replaceRefBase", "refs/replace-mine"), |
| 399 | 399 | ("gitoxide.committer.nameFallback", "committer name"), |
| 400 | 400 | ("gitoxide.committer.emailFallback", "committer email"), |