diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
commit | c23a457e72abe608715ac76f076f47dc42af07a5 (patch) | |
tree | 2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/gix/src/config/cache/init.rs | |
parent | Releasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip |
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix/src/config/cache/init.rs')
-rw-r--r-- | vendor/gix/src/config/cache/init.rs | 58 |
1 files changed, 52 insertions, 6 deletions
diff --git a/vendor/gix/src/config/cache/init.rs b/vendor/gix/src/config/cache/init.rs index 6fcbcc4ec..3c482b154 100644 --- a/vendor/gix/src/config/cache/init.rs +++ b/vendor/gix/src/config/cache/init.rs @@ -13,6 +13,7 @@ use crate::{ Cache, }, open, + repository::init::setup_objects, }; /// Initialization @@ -71,7 +72,7 @@ impl Cache { let config = { let git_prefix = &git_prefix; - let metas = [ + let mut metas = [ gix_config::source::Kind::GitInstallation, gix_config::source::Kind::System, gix_config::source::Kind::Global, @@ -99,7 +100,7 @@ impl Cache { let err_on_nonexisting_paths = false; let mut globals = gix_config::File::from_paths_metadata_buf( - metas, + &mut metas, &mut buf, err_on_nonexisting_paths, gix_config::file::init::Options { @@ -150,6 +151,7 @@ impl Cache { true, lenient_config, )?; + #[cfg(feature = "revision")] let object_kind_hint = util::disambiguate_hint(&config, lenient_config)?; let (static_pack_cache_limit_bytes, pack_cache_bytes, object_cache_bytes) = util::parse_object_caches(&config, lenient_config, filter_config_section)?; @@ -158,6 +160,7 @@ impl Cache { resolved: config.into(), use_multi_pack_index, object_hash, + #[cfg(feature = "revision")] object_kind_hint, static_pack_cache_limit_bytes, pack_cache_bytes, @@ -173,9 +176,11 @@ impl Cache { user_agent: Default::default(), personas: Default::default(), url_rewrite: Default::default(), + #[cfg(feature = "blob-diff")] diff_renames: Default::default(), #[cfg(any(feature = "blocking-network-client", feature = "async-network-client"))] url_scheme: Default::default(), + #[cfg(feature = "blob-diff")] diff_algorithm: Default::default(), }) } @@ -210,19 +215,26 @@ impl Cache { false, self.lenient_config, )?; - let object_kind_hint = util::disambiguate_hint(config, self.lenient_config)?; + + #[cfg(feature = "revision")] + { + let object_kind_hint = util::disambiguate_hint(config, self.lenient_config)?; + self.object_kind_hint = object_kind_hint; + } let reflog = util::query_refupdates(config, self.lenient_config)?; self.hex_len = hex_len; self.ignore_case = ignore_case; - self.object_kind_hint = object_kind_hint; self.reflog = reflog; self.user_agent = Default::default(); self.personas = Default::default(); self.url_rewrite = Default::default(); - self.diff_renames = Default::default(); - self.diff_algorithm = Default::default(); + #[cfg(feature = "blob-diff")] + { + self.diff_renames = Default::default(); + self.diff_algorithm = Default::default(); + } ( self.static_pack_cache_limit_bytes, self.pack_cache_bytes, @@ -268,8 +280,19 @@ impl crate::Repository { &mut self, config: crate::Config, ) -> Result<(), Error> { + let (a, b, c) = ( + self.config.static_pack_cache_limit_bytes, + self.config.pack_cache_bytes, + self.config.object_cache_bytes, + ); self.config.reread_values_and_clear_caches_replacing_config(config)?; self.apply_changed_values(); + if a != self.config.static_pack_cache_limit_bytes + || b != self.config.pack_cache_bytes + || c != self.config.object_cache_bytes + { + setup_objects(&mut self.objects, &self.config); + } Ok(()) } @@ -446,6 +469,29 @@ fn apply_environment_overrides( }], ), ( + "gitoxide", + Some(Cow::Borrowed("pathspec".into())), + git_prefix, + &[ + { + let key = &gitoxide::Pathspec::LITERAL; + (env(key), key.name) + }, + { + let key = &gitoxide::Pathspec::GLOB; + (env(key), key.name) + }, + { + let key = &gitoxide::Pathspec::NOGLOB; + (env(key), key.name) + }, + { + let key = &gitoxide::Pathspec::ICASE; + (env(key), key.name) + }, + ], + ), + ( "ssh", None, git_prefix, |