From 3c7b7b3a7b981040cd51417202d7022597179114 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 17 May 2024 07:11:40 +0200 Subject: [PATCH] fix: empty paths as configured will not be an error with lenient configuration enabled. (#1370) When using `gix::open_opts(path, options.strict_config(false))`, empty `core.excludesFile` values will not cause an error anymore. Note that in strict mode, the behaviour is unchanged so invalid configuration can rather be fixed than ignored. --- gix/src/config/cache/access.rs | 9 ++++++ gix/src/repository/attributes.rs | 1 - .../generated-archives/make_basic_repo.tar.xz | Bin 11932 -> 12176 bytes gix/tests/fixtures/make_basic_repo.sh | 5 ++++ gix/tests/repository/excludes.rs | 28 ++++++++++++++++++ gix/tests/repository/mod.rs | 3 ++ 6 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 gix/tests/repository/excludes.rs diff --git a/gix/src/config/cache/access.rs b/gix/src/config/cache/access.rs index 660ab771a7a..f35699aa09d 100644 --- a/gix/src/config/cache/access.rs +++ b/gix/src/config/cache/access.rs @@ -219,6 +219,8 @@ impl Cache { subsection_name: Option<&BStr>, key: impl AsRef, ) -> Option, gix_config::path::interpolate::Error>> { + let section_name = section_name.as_ref(); + let key = key.as_ref(); let path = self.resolved.path_filter( section_name, subsection_name, @@ -226,6 +228,13 @@ impl Cache { &mut self.filter_config_section.clone(), )?; + if self.lenient_config && path.is_empty() { + gix_trace::info!( + "Ignored empty path at {section_name}.{subsection_name:?}.{key} due to lenient configuration" + ); + return None; + } + let install_dir = crate::path::install_dir().ok(); let home = self.home_dir(); let ctx = config::cache::interpolate_context(install_dir.as_deref(), home.as_deref()); diff --git a/gix/src/repository/attributes.rs b/gix/src/repository/attributes.rs index 06bcb569970..55e28e3ff49 100644 --- a/gix/src/repository/attributes.rs +++ b/gix/src/repository/attributes.rs @@ -105,7 +105,6 @@ impl Repository { /// /// When only excludes are desired, this is the most efficient way to obtain them. Otherwise use /// [`Repository::attributes()`] for accessing both attributes and excludes. - // TODO: test #[doc(alias = "is_path_ignored", alias = "git2")] #[cfg(feature = "excludes")] pub fn excludes( diff --git a/gix/tests/fixtures/generated-archives/make_basic_repo.tar.xz b/gix/tests/fixtures/generated-archives/make_basic_repo.tar.xz index dc37073d9cdc3f07331328b5b666ebf0bd649f68..454da7b4bb150ba7b7c3178376d78d691df663b6 100644 GIT binary patch delta 12037 zcmV+gFZ$4&U65ap7zN~O|1V9E9ov68JouV;>6w8n;1uu2nj`P!L;u3$+-|ZYKy@Lj zzRnkn`h6D40=IL=JnN1~i@oV#xZ%_KDNAvLo*oM~(@9Y0bVIi6GN>wJtV5ytP_~|9 zAi?RJKb6LUUcx(_u27q7K)~q=j_b1I`NTA;I22=*p;Ag$WZ#_6QpyzK9#4PiA(k1) z7%vv&#p2TfCilZSZh`%gO(*ur*#~Cf2acy7lueiuhkws3gl6#dbfhk8=hjC3jKv*3 z={dgr#w;{iU!eNlY&;(B-DdDJ^qo+PE!~9R_qmLC5%c={nJDBtgrg;fc0?w zaE`q6#r1k~-&fGTB-ma1(D$9hrRU1U#GWEbx?KnTARVin|KhgG_TS7xJsA{>*)Iq_lq)B`a`P;+FbC zvQ)KSnIywq()cdSkq99CiK$sT1-lVVv2y?Z&=nueU^;(gsSL!%bbkb-xu~!Bb~8@+ z5-Pk4lA`%C?iEoF7r!@6>QvgHtcsV7OG-$3kk1=TsJ2}jO2WS_RHIYDbT{a{xVH*d zc%!OXy$uYGmWhs*eYAf8%;Y=#=kD^IG(>+V-zMABmTF#~LqI+JKZ)&>$`uC;`q(SZ zFrIptZy9!EU?j3Cb`a?))aqmMGd(dlB!-63N;xrPucmTRDrAS_Hy^0k`l3@xd77i< zv!Fcq3M@V*+wdsl4K}gR2g#Q%oQVvS zI#Cw};~`@#6A-;jUwVkBkf(Ze_IHKvm0XzS|HC1ZuTG(e6_jSZueD z!*b>3-0Vxy4%TgS26qZB!#`Y+Kaijwv@EnPvjS-KtYCR>#UR^?C0TFyso*8Z;VuPt zv&n06nm4c(w5xw3sxdunKNI|P6tI4lO!XVlCV6~YvnJA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DD*q*pQH?91`{Z#7`MXs&HL?GJl?3kxS@AT78>(q^FR(iskk0#9s zkearEP;RB>evP)kaY9FtXLa5qC-qq`|EQk)~8;LowN{u{kT4ic-+!X^Rc+>+)$bqTEurLvj1teaIH+K zyzEI{DP4?@_feI!jWT#&ZZRwJ0gj*M8W-gQH%(mw>&UcBmqWE;E;7<5t!CM#KjivF zdh#Vx6eTU$w$wieLZd1FnDnX!n$fZYutn(p*AQMuqBnoJ7=e=pS%`X@Hm5 zKIeot5eDkA@ldSeS>Z9XF$4dtzGMdQR<<{=34z-bm@(kMvA7wB-(mvk(jEE%_Ey!= xc+K}=#)NGsLM|Gw004`4KLePS>74)p_gsLC4*;f@&$O|`XZr#G00004Sz5_uCj$Tg diff --git a/gix/tests/fixtures/make_basic_repo.sh b/gix/tests/fixtures/make_basic_repo.sh index ac50aea64cb..4bf4b59cac7 100755 --- a/gix/tests/fixtures/make_basic_repo.sh +++ b/gix/tests/fixtures/make_basic_repo.sh @@ -31,4 +31,9 @@ git init all-untracked >a mkdir d >d/a +) + +git init empty-core-excludes +(cd empty-core-excludes + echo $'[core]\n\texcludesFile = ' >> .git/config ) \ No newline at end of file diff --git a/gix/tests/repository/excludes.rs b/gix/tests/repository/excludes.rs new file mode 100644 index 00000000000..5904b4be425 --- /dev/null +++ b/gix/tests/repository/excludes.rs @@ -0,0 +1,28 @@ +use crate::util::named_subrepo_opts; +use gix_worktree::stack::state::ignore::Source; + +#[test] +fn empty_core_excludes() -> crate::Result { + let repo = named_subrepo_opts( + "make_basic_repo.sh", + "empty-core-excludes", + gix::open::Options::default().strict_config(true), + )?; + let index = repo.index_or_empty()?; + match repo.excludes(&index, None, Source::WorktreeThenIdMappingIfNotSkipped) { + Ok(_) => { + unreachable!("Should fail due to empty excludes path") + } + Err(err) => { + assert_eq!( + err.to_string(), + "The value for `core.excludesFile` could not be read from configuration" + ); + } + }; + + let repo = gix::open_opts(repo.git_dir(), repo.open_options().clone().strict_config(false))?; + repo.excludes(&index, None, Source::WorktreeThenIdMappingIfNotSkipped) + .expect("empty paths are now just skipped"); + Ok(()) +} diff --git a/gix/tests/repository/mod.rs b/gix/tests/repository/mod.rs index 646d08c6829..750987bc590 100644 --- a/gix/tests/repository/mod.rs +++ b/gix/tests/repository/mod.rs @@ -1,6 +1,8 @@ use gix::Repository; mod config; +#[cfg(feature = "excludes")] +mod excludes; #[cfg(feature = "attributes")] mod filter; mod object; @@ -38,6 +40,7 @@ mod dirwalk { ("all-untracked".to_string(), Repository), ("bare-repo-with-index.git".to_string(), Directory), ("bare.git".into(), Directory), + ("empty-core-excludes".into(), Repository), ("non-bare-repo-without-index".into(), Repository), ("some".into(), Directory), ];