…even though there is still something fishy about the configuration that we create as it apparenlty is unable to see the overrides. Is it a filter, maybe?
Unified · Split
| @@ -110,8 +110,7 @@ impl<'repo> SnapshotMut<'repo> { · 109 unmodified lines | ||
| 110 | 110 | &mut self, |
| 111 | 111 | repo: &'repo mut crate::Repository, |
| 112 | 112 | ) -> Result<&'repo mut crate::Repository, crate::config::Error> { |
| 113 | − repo.config | |
| 114 | − .reread_values_and_clear_caches_replacing_config(std::mem::take(&mut self.config).into())?; | |
| 113 | + repo.reread_values_and_clear_caches_replacing_config(std::mem::take(&mut self.config).into())?; | |
| 115 | 114 | Ok(repo) |
| 116 | 115 | } |
| 117 | 116 | |
| @@ -145,8 +144,7 @@ impl<'repo> CommitAutoRollback<'repo> { · 27 unmodified lines | ||
| 145 | 144 | &mut self, |
| 146 | 145 | repo: &'repo mut crate::Repository, |
| 147 | 146 | ) -> Result<&'repo mut crate::Repository, crate::config::Error> { |
| 148 | − repo.config | |
| 149 | − .reread_values_and_clear_caches_replacing_config(OwnShared::clone(&self.prev_config))?; | |
| 147 | + repo.reread_values_and_clear_caches_replacing_config(OwnShared::clone(&self.prev_config))?; | |
| 150 | 148 | Ok(repo) |
| 151 | 149 | } |
| 152 | 150 | } |
| @@ -463,12 +463,22 @@ impl Repository { · 462 unmodified lines | ||
| 463 | 463 | /// |
| 464 | 464 | /// Similar to `reread_values_and_clear_caches_replacing_config()`, but works on the existing instance instead of a passed |
| 465 | 465 | /// in one that it them makes the default. |
| 466 | − pub fn reread_values_and_clear_caches(&mut self) -> Result<(), config::Error> { | |
| 466 | + pub(crate) fn reread_values_and_clear_caches(&mut self) -> Result<(), config::Error> { | |
| 467 | 467 | self.config.reread_values_and_clear_caches()?; |
| 468 | 468 | self.apply_changed_values(); |
| 469 | 469 | Ok(()) |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | + /// Replace our own configuration with `config` and re-read all cached values, and apply them to select in-memory instances. | |
| 473 | + pub(crate) fn reread_values_and_clear_caches_replacing_config( | |
| 474 | + &mut self, | |
| 475 | + config: crate::Config, | |
| 476 | + ) -> Result<(), config::Error> { | |
| 477 | + self.config.reread_values_and_clear_caches_replacing_config(config)?; | |
| 478 | + self.apply_changed_values(); | |
| 479 | + Ok(()) | |
| 480 | + } | |
| 481 | + | |
| 472 | 482 | fn apply_changed_values(&mut self) { |
| 473 | 483 | self.refs.write_reflog = reflog_or_default(self.config.reflog, self.work_dir().is_some()); |
| 474 | 484 | } |