diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
commit | 9835e2ae736235810b4ea1c162ca5e65c547e770 (patch) | |
tree | 3fcebf40ed70e581d776a8a4c65923e8ec20e026 /vendor/gix-ref | |
parent | Releasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff) | |
download | rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-ref')
-rw-r--r-- | vendor/gix-ref/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/gix-ref/Cargo.toml | 31 | ||||
-rw-r--r-- | vendor/gix-ref/src/lib.rs | 28 | ||||
-rw-r--r-- | vendor/gix-ref/src/log.rs | 2 | ||||
-rw-r--r-- | vendor/gix-ref/src/name.rs | 9 | ||||
-rw-r--r-- | vendor/gix-ref/src/raw.rs | 2 | ||||
-rw-r--r-- | vendor/gix-ref/src/store/file/find.rs | 52 | ||||
-rw-r--r-- | vendor/gix-ref/src/store/file/log/mod.rs | 4 | ||||
-rw-r--r-- | vendor/gix-ref/src/store/file/loose/mod.rs | 4 | ||||
-rw-r--r-- | vendor/gix-ref/src/store/file/overlay_iter.rs | 2 | ||||
-rw-r--r-- | vendor/gix-ref/src/store/file/packed.rs | 4 | ||||
-rw-r--r-- | vendor/gix-ref/src/store/file/transaction/mod.rs | 8 | ||||
-rw-r--r-- | vendor/gix-ref/src/store/packed/find.rs | 2 |
13 files changed, 64 insertions, 86 deletions
diff --git a/vendor/gix-ref/.cargo-checksum.json b/vendor/gix-ref/.cargo-checksum.json index dfc3b1e66..81c1f8d9e 100644 --- a/vendor/gix-ref/.cargo-checksum.json +++ b/vendor/gix-ref/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"294774f5e1135792390a98b9b3483c83146ac30bf2543f3c155877e26c209388","src/fullname.rs":"bf5474ae029a6537d67380ba372521740ef01236d5e2c5cae14801cc2a55a615","src/lib.rs":"e09ca2a32a38bb2cf3f908d1eae8f35d01486b396253ada7fa82ae5c8afbc1d0","src/log.rs":"9c52e16a82ad8e59af00feff2206b46d5b08b007229dce8ad841d74639dcfa25","src/name.rs":"8319442bd162bb1475c236cc816ff48e5203310ef534e3772db4f917fe41620d","src/namespace.rs":"4526a9de69bc32a4fc57d386ab3e2706ebd9e8897cdc12a53c475b0a617cb3ac","src/parse.rs":"c6956a4303e996955285d3fc255bd38734c832bc877d5ae63a77ee292989c0cf","src/peel.rs":"fb576b55b4d17fe9abc12cf1fb55753937810feeb8f79a36c52ae2ac8a3abff0","src/raw.rs":"c45ab1953e2e44645c48df33abd6aa920182b39c92853bebb90aed1a67cddae0","src/store/file/find.rs":"a5e642b310e5dc8285c89f00cf0ed46fdfcb3f19e7ec59cb2264b8312bbd2223","src/store/file/log/iter.rs":"cfba6583d0fbf21e16d515e14d6e71a624291bc6910dde60642c309b24a9c275","src/store/file/log/line.rs":"fbfd0faff68ec950ef35b17f3cfd535ffe02b6b1f23540a93134daf81900a728","src/store/file/log/mod.rs":"072ad9e0864bdce813913a3421cce81bcac7ca4fe2ab514092b7f97b8082556c","src/store/file/loose/iter.rs":"f1236fd18e467863f1227862226643cc05af22708485ae1475ce1a69c0502287","src/store/file/loose/mod.rs":"a5f2ae47631c8f1b214eecd52ea749866732c740deea3e122eb8e33b6ce30152","src/store/file/loose/reference/decode.rs":"e0dee458982c0d24052b57a356a347ec0eb01ffd7e829e593551974c0fd4c038","src/store/file/loose/reference/logiter.rs":"dc25b669f26f9c6c8aaf2186e48714bec065e80e9d06112b31e462bbd5c0f2f2","src/store/file/loose/reference/mod.rs":"bfbf39a4c7b9ff8dac40a6fcc334992fbe778de86d86787cf8c7ac5467d65304","src/store/file/loose/reflog.rs":"2aeef1c5a64ee5bfb76008d8eda0010da121abd23b54582c95b2a980bd55dbbc","src/store/file/loose/reflog/create_or_update/tests.rs":"0a782c2fe0900c92aa02894d48b10b99835ce202964213acdaee167e59533cc0","src/store/file/mod.rs":"dab1cabd111bcd68c0ec62ba0b9034f9665a79673cae23bcff269fa4b162ceb9","src/store/file/overlay_iter.rs":"a5124b85d23b5a5f198b98aa06f3c86216374be77f39c479f0b459610bfde650","src/store/file/packed.rs":"e07010dc64c8a42e2b35714330dcbc683ec89620b4201889bf508c807383f2ee","src/store/file/raw_ext.rs":"2478fb22c1129d72af102a08e5058af7e7e3224c91f05d485622fe4688ffd817","src/store/file/transaction/commit.rs":"bd0c3d2aa89814a4ba586ed17a4874ce282a64d1de97f7f2b3e66794a11f8f8e","src/store/file/transaction/mod.rs":"3c8a35ce97b852255337b4679ab4144464f8b76630cf75b4aa990361f671a314","src/store/file/transaction/prepare.rs":"13187385a24c6e935e29d19776c2ae35e79c0ae57722db73348935c8643b0c7b","src/store/general/handle/find.rs":"ae228a17df534d8231d68093c209d02de03d102fac1a76a8b12906248c50412e","src/store/general/handle/mod.rs":"5f6c9bc2a2a20bc08807bdf2324e2f22461dbed609cebe5dfa25d6c096514f40","src/store/general/init.rs":"107b62c8ca50d84f95b56c8894572147a5aee585ca52cd6db6213c87db91779d","src/store/general/mod.rs":"0ed6247438790f38b75ab62bffa70ddb73c873fd2d05552c19af1fdaf604773b","src/store/mod.rs":"d160b6f8a2388fe6978cd94675af910d85f2030168bba4a173a30384948ac3ec","src/store/packed/buffer.rs":"2aeabde07415b2f3f080b6a1a5501e637f2ff99d0c2630530851d0acbd82e1d6","src/store/packed/decode.rs":"380fab290cd3d81ba77b7f87f4610dd47c9755a896359b33579bf9b8f09a16db","src/store/packed/decode/tests.rs":"5e66f4ca73b65336dcac8580243b5a53b6a0bf842579396ab08dc9d6a8386dd8","src/store/packed/find.rs":"8e148068d8f077b235d259f7302c356ec029e0e145ee41e47030a552e740bbd8","src/store/packed/iter.rs":"6aaa45aac6141f6c9c93cf56384a4b77c9a75ffd430ebbf8329a08a72688a6e6","src/store/packed/mod.rs":"711cf43cf67dff52dab1ccc7624962f805b4f4c1337ce5bfca3d315261bdf607","src/store/packed/transaction.rs":"5c9bddcd756262791dc706c008d5766eb61227d016eb2fda95c798fa64ca6f58","src/target.rs":"dce5cedb767a4ec03d3882881c5aa4af4fbf2d68240233386650badee73086fe","src/transaction/ext.rs":"7936d319b9e2230b8040c0c55a06dc5282f0e0f75f8a654c0d5d0163ecb86af5","src/transaction/mod.rs":"590a68708dd98069504f2a9d58e9adfd4ad001f673b832798ad0ec71d36ca3b9"},"package":"90a0ed29e581f04b904ecd0c32b11f33b8209b5a0af9c43f415249a4f2fba632"}
\ No newline at end of file +{"files":{"Cargo.toml":"722588b75f0712bd638a45a4290a6a4366dde2f8d89034c56ebe04683a1daa9e","src/fullname.rs":"bf5474ae029a6537d67380ba372521740ef01236d5e2c5cae14801cc2a55a615","src/lib.rs":"e53195d9b6c59867b637239953cbabebcfe5cfe53af285a7211b84876b383e7d","src/log.rs":"93deed22815142228ec068da01bb43156b15319e549b8f5122c8183d97e2d1a6","src/name.rs":"49667688878b612836737072f04b6bc8b8d6ccdeb6f8128d9fab5632fa385b54","src/namespace.rs":"4526a9de69bc32a4fc57d386ab3e2706ebd9e8897cdc12a53c475b0a617cb3ac","src/parse.rs":"c6956a4303e996955285d3fc255bd38734c832bc877d5ae63a77ee292989c0cf","src/peel.rs":"fb576b55b4d17fe9abc12cf1fb55753937810feeb8f79a36c52ae2ac8a3abff0","src/raw.rs":"d2ebd06b2b34553732a771a3e61102b0e786bdfb7960d095d001372c4c9a1f6e","src/store/file/find.rs":"22f544ecbffb08334ce2433d7ecfdba2971bedbf2bf5984387eebf0d02050eb5","src/store/file/log/iter.rs":"cfba6583d0fbf21e16d515e14d6e71a624291bc6910dde60642c309b24a9c275","src/store/file/log/line.rs":"fbfd0faff68ec950ef35b17f3cfd535ffe02b6b1f23540a93134daf81900a728","src/store/file/log/mod.rs":"2f3ce7b943f3fdd4dfdfd7b18f051a38d7e5e64067d144315faa4b47c22dc10b","src/store/file/loose/iter.rs":"f1236fd18e467863f1227862226643cc05af22708485ae1475ce1a69c0502287","src/store/file/loose/mod.rs":"2abb44cb8509f1040cad946fe2b641862aa4734cf43988561ebddc503ade4fb6","src/store/file/loose/reference/decode.rs":"e0dee458982c0d24052b57a356a347ec0eb01ffd7e829e593551974c0fd4c038","src/store/file/loose/reference/logiter.rs":"dc25b669f26f9c6c8aaf2186e48714bec065e80e9d06112b31e462bbd5c0f2f2","src/store/file/loose/reference/mod.rs":"bfbf39a4c7b9ff8dac40a6fcc334992fbe778de86d86787cf8c7ac5467d65304","src/store/file/loose/reflog.rs":"2aeef1c5a64ee5bfb76008d8eda0010da121abd23b54582c95b2a980bd55dbbc","src/store/file/loose/reflog/create_or_update/tests.rs":"0a782c2fe0900c92aa02894d48b10b99835ce202964213acdaee167e59533cc0","src/store/file/mod.rs":"dab1cabd111bcd68c0ec62ba0b9034f9665a79673cae23bcff269fa4b162ceb9","src/store/file/overlay_iter.rs":"3712a348e723a9643289185aa18770c3bd23d956da21e67d1ff90f4dd0d155ad","src/store/file/packed.rs":"1a4c2dfe39fdfe94ff6b045a1021ff3fd8f15332558eb23b7ce330e1abb258c7","src/store/file/raw_ext.rs":"2478fb22c1129d72af102a08e5058af7e7e3224c91f05d485622fe4688ffd817","src/store/file/transaction/commit.rs":"bd0c3d2aa89814a4ba586ed17a4874ce282a64d1de97f7f2b3e66794a11f8f8e","src/store/file/transaction/mod.rs":"857cbf3e9aedcd659f47389638347506d52b59263bad2c2ea48046e2a33d18af","src/store/file/transaction/prepare.rs":"13187385a24c6e935e29d19776c2ae35e79c0ae57722db73348935c8643b0c7b","src/store/general/handle/find.rs":"ae228a17df534d8231d68093c209d02de03d102fac1a76a8b12906248c50412e","src/store/general/handle/mod.rs":"5f6c9bc2a2a20bc08807bdf2324e2f22461dbed609cebe5dfa25d6c096514f40","src/store/general/init.rs":"107b62c8ca50d84f95b56c8894572147a5aee585ca52cd6db6213c87db91779d","src/store/general/mod.rs":"0ed6247438790f38b75ab62bffa70ddb73c873fd2d05552c19af1fdaf604773b","src/store/mod.rs":"d160b6f8a2388fe6978cd94675af910d85f2030168bba4a173a30384948ac3ec","src/store/packed/buffer.rs":"2aeabde07415b2f3f080b6a1a5501e637f2ff99d0c2630530851d0acbd82e1d6","src/store/packed/decode.rs":"380fab290cd3d81ba77b7f87f4610dd47c9755a896359b33579bf9b8f09a16db","src/store/packed/decode/tests.rs":"5e66f4ca73b65336dcac8580243b5a53b6a0bf842579396ab08dc9d6a8386dd8","src/store/packed/find.rs":"8edd89aec77c292909323b8fe504962f352e5ef16ebf1a55a6205bb752f061e2","src/store/packed/iter.rs":"6aaa45aac6141f6c9c93cf56384a4b77c9a75ffd430ebbf8329a08a72688a6e6","src/store/packed/mod.rs":"711cf43cf67dff52dab1ccc7624962f805b4f4c1337ce5bfca3d315261bdf607","src/store/packed/transaction.rs":"5c9bddcd756262791dc706c008d5766eb61227d016eb2fda95c798fa64ca6f58","src/target.rs":"dce5cedb767a4ec03d3882881c5aa4af4fbf2d68240233386650badee73086fe","src/transaction/ext.rs":"7936d319b9e2230b8040c0c55a06dc5282f0e0f75f8a654c0d5d0163ecb86af5","src/transaction/mod.rs":"590a68708dd98069504f2a9d58e9adfd4ad001f673b832798ad0ec71d36ca3b9"},"package":"b8212ecfe41815a2f1b059d82171d6276758cfac5506a5e0f04ad45ef0b1924a"}
\ No newline at end of file diff --git a/vendor/gix-ref/Cargo.toml b/vendor/gix-ref/Cargo.toml index f6233ec47..fdbe2484a 100644 --- a/vendor/gix-ref/Cargo.toml +++ b/vendor/gix-ref/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.64" name = "gix-ref" -version = "0.26.0" +version = "0.29.0" authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"] include = ["src/**/*"] autotests = false @@ -24,7 +24,7 @@ repository = "https://github.com/Byron/gitoxide" [package.metadata.docs.rs] features = [ "document-features", - "serde1", + "serde", ] rustdoc-args = [ "--cfg", @@ -40,26 +40,29 @@ version = "0.2.1" optional = true [dependencies.gix-actor] -version = "^0.19.0" +version = "^0.20.0" [dependencies.gix-features] -version = "^0.28.0" +version = "^0.29.0" features = ["walkdir"] +[dependencies.gix-fs] +version = "^0.1.1" + [dependencies.gix-hash] -version = "^0.10.3" +version = "^0.11.1" [dependencies.gix-lock] -version = "^4.0.0" +version = "^5.0.0" [dependencies.gix-object] -version = "^0.28.0" +version = "^0.29.1" [dependencies.gix-path] -version = "^0.7.2" +version = "^0.8.0" [dependencies.gix-tempfile] -version = "^4.0.0" +version = "^5.0.0" default-features = false [dependencies.gix-validate] @@ -86,9 +89,9 @@ version = "1.0.34" version = "3.2.0" [features] -serde1 = [ - "serde", - "gix-hash/serde1", - "gix-actor/serde1", - "gix-object/serde1", +serde = [ + "dep:serde", + "gix-hash/serde", + "gix-actor/serde", + "gix-object/serde", ] diff --git a/vendor/gix-ref/src/lib.rs b/vendor/gix-ref/src/lib.rs index b18d67c4a..cd2e8c27e 100644 --- a/vendor/gix-ref/src/lib.rs +++ b/vendor/gix-ref/src/lib.rs @@ -57,22 +57,17 @@ pub mod peel; /// pub mod store { /// The way a file store handles the reflog - #[derive(Debug, PartialOrd, PartialEq, Ord, Eq, Hash, Clone, Copy)] + #[derive(Default, Debug, PartialOrd, PartialEq, Ord, Eq, Hash, Clone, Copy)] pub enum WriteReflog { /// Always write the reflog for all references for ref edits, unconditionally. Always, /// Write a ref log for ref edits according to the standard rules. + #[default] Normal, /// Never write a ref log. Disable, } - impl Default for WriteReflog { - fn default() -> Self { - WriteReflog::Normal - } - } - /// A thread-local handle for interacting with a [`Store`][crate::Store] to find and iterate references. #[derive(Clone)] #[allow(dead_code)] @@ -104,28 +99,27 @@ pub(crate) struct Store { inner: store::State, } -/// Indicate that the given BString is a validate reference name or path that can be used as path on disk or written as target -/// of a symbolic reference +/// A validated complete and fully qualified referenced reference name, safe to use for all operations. #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)] -#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct FullName(pub(crate) BString); -/// A validated and potentially partial reference name - it can safely be used for common operations. +/// A validated complete and fully qualified referenced reference name, safe to use for all operations. #[derive(Hash, Debug, PartialEq, Eq, Ord, PartialOrd)] #[repr(transparent)] pub struct FullNameRef(BStr); -/// A validated complete and fully qualified reference name, safe to use for all operations. +/// A validated and potentially partial reference name, safe to use for common operations. #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)] pub struct PartialNameCow<'a>(Cow<'a, BStr>); -/// A validated complete and fully qualified referenced reference name, safe to use for all operations. +/// A validated and potentially partial reference name, safe to use for common operations. #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd)] #[repr(transparent)] pub struct PartialNameRef(BStr); -/// A validated complete and fully qualified owned reference name, safe to use for all operations. -#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd)] +/// A validated and potentially partial reference name, safe to use for common operations. +#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)] pub struct PartialName(BString); /// A _validated_ prefix for references to act as a namespace. @@ -134,7 +128,7 @@ pub struct Namespace(BString); /// Denotes the kind of reference. #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)] -#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Kind { /// A ref that points to an object id Peeled, @@ -185,7 +179,7 @@ pub enum Category<'a> { /// Denotes a ref target, equivalent to [`Kind`], but with mutable data. #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)] -#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum Target { /// A ref that points to an object id Peeled(ObjectId), diff --git a/vendor/gix-ref/src/log.rs b/vendor/gix-ref/src/log.rs index 42ce97aa9..45273ee23 100644 --- a/vendor/gix-ref/src/log.rs +++ b/vendor/gix-ref/src/log.rs @@ -3,7 +3,7 @@ use gix_object::bstr::BString; /// A parsed ref log line that can be changed #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)] -#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Line { /// The previous object id. Can be a null-sha to indicate this is a line for a new ref. pub previous_oid: ObjectId, diff --git a/vendor/gix-ref/src/name.rs b/vendor/gix-ref/src/name.rs index dbf96c1e5..5c22069a9 100644 --- a/vendor/gix-ref/src/name.rs +++ b/vendor/gix-ref/src/name.rs @@ -69,14 +69,9 @@ impl PartialNameRef { || name.starts_with(Category::LinkedPseudoRef { name: "".into() }.prefix()) || is_pseudo_ref(name) } - pub(crate) fn construct_full_name_ref<'buf>( - &self, - add_refs_prefix: bool, - inbetween: &str, - buf: &'buf mut BString, - ) -> &'buf FullNameRef { + pub(crate) fn construct_full_name_ref<'buf>(&self, inbetween: &str, buf: &'buf mut BString) -> &'buf FullNameRef { buf.clear(); - if add_refs_prefix && !self.looks_like_full_name() { + if !self.looks_like_full_name() { buf.push_str("refs/"); } if !inbetween.is_empty() { diff --git a/vendor/gix-ref/src/raw.rs b/vendor/gix-ref/src/raw.rs index fd1f9db34..ed0b8fe9f 100644 --- a/vendor/gix-ref/src/raw.rs +++ b/vendor/gix-ref/src/raw.rs @@ -4,7 +4,7 @@ use crate::{FullName, Target}; /// A fully owned backend agnostic reference #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)] -#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Reference { /// The path to uniquely identify this ref within its store. pub name: FullName, diff --git a/vendor/gix-ref/src/store/file/find.rs b/vendor/gix-ref/src/store/file/find.rs index 0c6d04b6c..7e1fc378f 100644 --- a/vendor/gix-ref/src/store/file/find.rs +++ b/vendor/gix-ref/src/store/file/find.rs @@ -13,11 +13,6 @@ use crate::{ BStr, BString, FullNameRef, PartialNameRef, Reference, }; -enum Transform { - EnforceRefsPrefix, - None, -} - impl file::Store { /// Find a single reference by the given `path` which is required to be a valid reference name. /// @@ -72,14 +67,8 @@ impl file::Store { packed: Option<&packed::Buffer>, ) -> Result<Option<Reference>, Error> { let mut buf = BString::default(); - if partial_name.looks_like_full_name() { - if let Some(r) = self.find_inner("", partial_name, None, Transform::None, &mut buf)? { - return Ok(Some(r)); - } - } - for inbetween in &["", "tags", "heads", "remotes"] { - match self.find_inner(inbetween, partial_name, packed, Transform::EnforceRefsPrefix, &mut buf) { + match self.find_inner(inbetween, partial_name, packed, &mut buf) { Ok(Some(r)) => return Ok(Some(r)), Ok(None) => { continue; @@ -87,17 +76,20 @@ impl file::Store { Err(err) => return Err(err), } } - self.find_inner( - "remotes", - partial_name - .to_owned() - .join("HEAD") - .expect("HEAD is valid name") - .as_ref(), - None, - Transform::EnforceRefsPrefix, - &mut buf, - ) + if partial_name.as_bstr() != "HEAD" { + self.find_inner( + "remotes", + partial_name + .to_owned() + .join("HEAD") + .expect("HEAD is valid name") + .as_ref(), + None, + &mut buf, + ) + } else { + Ok(None) + } } fn find_inner( @@ -105,11 +97,9 @@ impl file::Store { inbetween: &str, partial_name: &PartialNameRef, packed: Option<&packed::Buffer>, - transform: Transform, path_buf: &mut BString, ) -> Result<Option<Reference>, Error> { - let add_refs_prefix = matches!(transform, Transform::EnforceRefsPrefix); - let full_name = partial_name.construct_full_name_ref(add_refs_prefix, inbetween, path_buf); + let full_name = partial_name.construct_full_name_ref(inbetween, path_buf); let content_buf = self.ref_contents(full_name).map_err(|err| Error::ReadFileContents { source: err, path: self.reference_path(full_name), @@ -166,10 +156,10 @@ impl file::Store { let linked_git_dir = |worktree_name: &BStr| commondir.join("worktrees").join(gix_path::from_bstr(worktree_name)); name.category_and_short_name() - .and_then(|(c, sn)| { + .map(|(c, sn)| { use crate::Category::*; let sn = FullNameRef::new_unchecked(sn); - Some(match c { + match c { LinkedPseudoRef { name: worktree_name } => is_reflog .then(|| (linked_git_dir(worktree_name).into(), sn)) .unwrap_or((commondir.into(), name)), @@ -186,10 +176,10 @@ impl file::Store { } }) .unwrap_or((commondir.into(), sn)), - PseudoRef | Bisect | Rewritten | WorktreePrivate => return None, - }) + PseudoRef | Bisect | Rewritten | WorktreePrivate => (self.git_dir.as_path().into(), name), + } }) - .unwrap_or((self.git_dir.as_path().into(), name)) + .unwrap_or((commondir.into(), name)) } /// Implements the logic required to transform a fully qualified refname into a filesystem path diff --git a/vendor/gix-ref/src/store/file/log/mod.rs b/vendor/gix-ref/src/store/file/log/mod.rs index 5791358e4..a9199be2b 100644 --- a/vendor/gix-ref/src/store/file/log/mod.rs +++ b/vendor/gix-ref/src/store/file/log/mod.rs @@ -8,7 +8,7 @@ mod line; /// A parsed ref log line. #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)] -#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[non_exhaustive] pub struct LineRef<'a> { /// The previous object id in hexadecimal. Use [`LineRef::previous_oid()`] to get a more usable form. @@ -16,7 +16,7 @@ pub struct LineRef<'a> { /// The new object id in hexadecimal. Use [`LineRef::new_oid()`] to get a more usable form. pub new_oid: &'a BStr, /// The signature of the currently configured committer. - #[cfg_attr(feature = "serde1", serde(borrow))] + #[cfg_attr(feature = "serde", serde(borrow))] pub signature: gix_actor::SignatureRef<'a>, /// The message providing details about the operation performed in this log line. pub message: &'a BStr, diff --git a/vendor/gix-ref/src/store/file/loose/mod.rs b/vendor/gix-ref/src/store/file/loose/mod.rs index 230641509..df51c389f 100644 --- a/vendor/gix-ref/src/store/file/loose/mod.rs +++ b/vendor/gix-ref/src/store/file/loose/mod.rs @@ -39,7 +39,7 @@ mod init { common_dir: None, write_reflog, namespace: None, - packed: gix_features::fs::MutableSnapshot::new().into(), + packed: gix_fs::SharedFileSnapshotMut::new().into(), object_hash, } } @@ -57,7 +57,7 @@ mod init { common_dir: Some(common_dir.into()), write_reflog, namespace: None, - packed: gix_features::fs::MutableSnapshot::new().into(), + packed: gix_fs::SharedFileSnapshotMut::new().into(), object_hash, } } diff --git a/vendor/gix-ref/src/store/file/overlay_iter.rs b/vendor/gix-ref/src/store/file/overlay_iter.rs index 51f290c7b..4c1109beb 100644 --- a/vendor/gix-ref/src/store/file/overlay_iter.rs +++ b/vendor/gix-ref/src/store/file/overlay_iter.rs @@ -118,7 +118,7 @@ impl<'p, 's> Iterator for LooseThenPacked<'p, 's> { fn next(&mut self) -> Option<Self::Item> { fn advance_to_non_private(iter: &mut Peekable<SortedLoosePaths>) { while let Some(Ok((_path, name))) = iter.peek() { - if name.category().map_or(true, |cat| cat.is_worktree_private()) { + if name.category().map_or(false, |cat| cat.is_worktree_private()) { iter.next(); } else { break; diff --git a/vendor/gix-ref/src/store/file/packed.rs b/vendor/gix-ref/src/store/file/packed.rs index 271ec7f5a..38fee6716 100644 --- a/vendor/gix-ref/src/store/file/packed.rs +++ b/vendor/gix-ref/src/store/file/packed.rs @@ -69,14 +69,14 @@ pub mod transaction { } /// An up-to-date snapshot of the packed refs buffer. -pub type SharedBufferSnapshot = gix_features::fs::SharedSnapshot<packed::Buffer>; +pub type SharedBufferSnapshot = gix_fs::SharedFileSnapshot<packed::Buffer>; pub(crate) mod modifiable { use gix_features::threading::OwnShared; use crate::{file, packed}; - pub(crate) type MutableSharedBuffer = OwnShared<gix_features::fs::MutableSnapshot<packed::Buffer>>; + pub(crate) type MutableSharedBuffer = OwnShared<gix_fs::SharedFileSnapshotMut<packed::Buffer>>; impl file::Store { pub(crate) fn force_refresh_packed_buffer(&self) -> Result<(), packed::buffer::open::Error> { diff --git a/vendor/gix-ref/src/store/file/transaction/mod.rs b/vendor/gix-ref/src/store/file/transaction/mod.rs index 712f0320d..c285cd525 100644 --- a/vendor/gix-ref/src/store/file/transaction/mod.rs +++ b/vendor/gix-ref/src/store/file/transaction/mod.rs @@ -19,8 +19,10 @@ pub type FindObjectFn<'a> = dyn FnMut( + 'a; /// How to handle packed refs during a transaction +#[derive(Default)] pub enum PackedRefs<'a> { /// Only propagate deletions of references. This is the default + #[default] DeletionsOnly, /// Propagate deletions as well as updates to references which are peeled, that is contain an object id DeletionsAndNonSymbolicUpdates(Box<FindObjectFn<'a>>), @@ -30,12 +32,6 @@ pub enum PackedRefs<'a> { DeletionsAndNonSymbolicUpdatesRemoveLooseSourceReference(Box<FindObjectFn<'a>>), } -impl Default for PackedRefs<'_> { - fn default() -> Self { - PackedRefs::DeletionsOnly - } -} - #[derive(Debug)] pub(in crate::store_impl::file) struct Edit { update: RefEdit, diff --git a/vendor/gix-ref/src/store/packed/find.rs b/vendor/gix-ref/src/store/packed/find.rs index abd35dfe2..8c1dcb5b2 100644 --- a/vendor/gix-ref/src/store/packed/find.rs +++ b/vendor/gix-ref/src/store/packed/find.rs @@ -26,7 +26,7 @@ impl packed::Buffer { }; (name, true) } else { - let full_name = name.construct_full_name_ref(true, inbetween, &mut buf); + let full_name = name.construct_full_name_ref(inbetween, &mut buf); (full_name, false) }; match self.try_find_full_name(name)? { |