diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/gix-ref/src/store | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-ref/src/store')
-rw-r--r-- | vendor/gix-ref/src/store/file/log/line.rs | 2 | ||||
-rw-r--r-- | vendor/gix-ref/src/store/file/loose/reflog.rs | 2 | ||||
-rw-r--r-- | vendor/gix-ref/src/store/file/overlay_iter.rs | 4 | ||||
-rw-r--r-- | vendor/gix-ref/src/store/file/raw_ext.rs | 6 | ||||
-rw-r--r-- | vendor/gix-ref/src/store/file/transaction/commit.rs | 6 | ||||
-rw-r--r-- | vendor/gix-ref/src/store/file/transaction/prepare.rs | 29 | ||||
-rw-r--r-- | vendor/gix-ref/src/store/general/handle/find.rs | 2 | ||||
-rw-r--r-- | vendor/gix-ref/src/store/general/init.rs | 2 | ||||
-rw-r--r-- | vendor/gix-ref/src/store/packed/transaction.rs | 2 |
9 files changed, 28 insertions, 27 deletions
diff --git a/vendor/gix-ref/src/store/file/log/line.rs b/vendor/gix-ref/src/store/file/log/line.rs index 1ac45c75c..99c118ea7 100644 --- a/vendor/gix-ref/src/store/file/log/line.rs +++ b/vendor/gix-ref/src/store/file/log/line.rs @@ -88,7 +88,7 @@ pub mod decode { mod error { use gix_object::bstr::{BString, ByteSlice}; - /// The error returned by [from_bytes(…)][super::Line::from_bytes()] + /// The error returned by [`from_bytes(…)`][super::Line::from_bytes()] #[derive(Debug)] pub struct Error { pub input: BString, diff --git a/vendor/gix-ref/src/store/file/loose/reflog.rs b/vendor/gix-ref/src/store/file/loose/reflog.rs index a43d773fe..88a8c2450 100644 --- a/vendor/gix-ref/src/store/file/loose/reflog.rs +++ b/vendor/gix-ref/src/store/file/loose/reflog.rs @@ -231,7 +231,7 @@ pub mod create_or_update { } mod error { - /// The error returned by [crate::file::Store::reflog_iter()]. + /// The error returned by [`crate::file::Store::reflog_iter()`]. #[derive(Debug, thiserror::Error)] #[allow(missing_docs)] pub enum Error { diff --git a/vendor/gix-ref/src/store/file/overlay_iter.rs b/vendor/gix-ref/src/store/file/overlay_iter.rs index 4c1109beb..795eda654 100644 --- a/vendor/gix-ref/src/store/file/overlay_iter.rs +++ b/vendor/gix-ref/src/store/file/overlay_iter.rs @@ -197,7 +197,7 @@ impl<'s> Platform<'s> { /// As [`iter(…)`][file::Store::iter()], but filters by `prefix`, i.e. "refs/heads". /// - /// Please note that "refs/heads` or "refs\\heads" is equivalent to "refs/heads/" + /// Please note that "refs/heads" or "refs\\heads" is equivalent to "refs/heads/" pub fn prefixed(&self, prefix: impl AsRef<Path>) -> std::io::Result<LooseThenPacked<'_, '_>> { self.store .iter_prefixed_packed(prefix, self.packed.as_ref().map(|b| &***b)) @@ -349,7 +349,7 @@ impl file::Store { /// As [`iter(…)`][file::Store::iter()], but filters by `prefix`, i.e. "refs/heads". /// - /// Please note that "refs/heads` or "refs\\heads" is equivalent to "refs/heads/" + /// Please note that "refs/heads" or "refs\\heads" is equivalent to "refs/heads/" pub fn iter_prefixed_packed<'s, 'p>( &'s self, prefix: impl AsRef<Path>, diff --git a/vendor/gix-ref/src/store/file/raw_ext.rs b/vendor/gix-ref/src/store/file/raw_ext.rs index 8bdf8392d..b99bbbdd9 100644 --- a/vendor/gix-ref/src/store/file/raw_ext.rs +++ b/vendor/gix-ref/src/store/file/raw_ext.rs @@ -17,17 +17,17 @@ pub trait ReferenceExt: Sealed { /// A step towards obtaining forward or reverse iterators on reference logs. fn log_iter<'a, 's>(&'a self, store: &'s file::Store) -> log::iter::Platform<'a, 's>; - /// For details, see [Reference::log_exists()]. + /// For details, see [`Reference::log_exists()`]. fn log_exists(&self, store: &file::Store) -> bool; - /// For details, see [Reference::peel_to_id_in_place()]. + /// For details, see [`Reference::peel_to_id_in_place()`]. fn peel_to_id_in_place<E: std::error::Error + Send + Sync + 'static>( &mut self, store: &file::Store, find: impl FnMut(gix_hash::ObjectId, &mut Vec<u8>) -> Result<Option<(gix_object::Kind, &[u8])>, E>, ) -> Result<ObjectId, peel::to_id::Error>; - /// For details, see [Reference::peel_to_id_in_place()], with support for a known stable packed buffer. + /// For details, see [`Reference::peel_to_id_in_place()`], with support for a known stable packed buffer. fn peel_to_id_in_place_packed<E: std::error::Error + Send + Sync + 'static>( &mut self, store: &file::Store, diff --git a/vendor/gix-ref/src/store/file/transaction/commit.rs b/vendor/gix-ref/src/store/file/transaction/commit.rs index 58e6a7c99..df32a1403 100644 --- a/vendor/gix-ref/src/store/file/transaction/commit.rs +++ b/vendor/gix-ref/src/store/file/transaction/commit.rs @@ -37,7 +37,7 @@ impl<'s, 'p> Transaction<'s, 'p> { ); // Perform updates first so live commits remain referenced - for change in updates.iter_mut() { + for change in &mut updates { assert!(!change.update.deref, "Deref mode is turned into splits and turned off"); match &change.update.change { // reflog first, then reference @@ -114,7 +114,7 @@ impl<'s, 'p> Transaction<'s, 'p> { } } - for change in updates.iter_mut() { + for change in &mut updates { let (reflog_root, relative_name) = self.store.reflog_base_and_relative_path(change.update.name.as_ref()); match &change.update.change { Change::Update { .. } => {} @@ -147,7 +147,7 @@ impl<'s, 'p> Transaction<'s, 'p> { self.store.force_refresh_packed_buffer().ok(); } - for change in updates.iter_mut() { + for change in &mut updates { let take_lock_and_delete = match &change.update.change { Change::Update { log: LogChange { mode, .. }, diff --git a/vendor/gix-ref/src/store/file/transaction/prepare.rs b/vendor/gix-ref/src/store/file/transaction/prepare.rs index fdb29619d..bfc5acabc 100644 --- a/vendor/gix-ref/src/store/file/transaction/prepare.rs +++ b/vendor/gix-ref/src/store/file/transaction/prepare.rs @@ -75,17 +75,17 @@ impl<'s, 'p> Transaction<'s, 'p> { (PreviousValue::MustNotExist, _) => { panic!("BUG: MustNotExist constraint makes no sense if references are to be deleted") } - (PreviousValue::ExistingMustMatch(_), None) - | (PreviousValue::MustExist, Some(_)) - | (PreviousValue::Any, Some(_)) - | (PreviousValue::Any, None) => {} - (PreviousValue::MustExist, None) | (PreviousValue::MustExistAndMatch(_), None) => { + (PreviousValue::ExistingMustMatch(_) | PreviousValue::Any, None) + | (PreviousValue::MustExist | PreviousValue::Any, Some(_)) => {} + (PreviousValue::MustExist | PreviousValue::MustExistAndMatch(_), None) => { return Err(Error::DeleteReferenceMustExist { full_name: change.name(), }) } - (PreviousValue::MustExistAndMatch(previous), Some(existing)) - | (PreviousValue::ExistingMustMatch(previous), Some(existing)) => { + ( + PreviousValue::MustExistAndMatch(previous) | PreviousValue::ExistingMustMatch(previous), + Some(existing), + ) => { let actual = existing.target.clone(); if *previous != actual { let expected = previous.clone(); @@ -124,8 +124,7 @@ impl<'s, 'p> Transaction<'s, 'p> { match (&expected, &existing_ref) { (PreviousValue::Any, _) | (PreviousValue::MustExist, Some(_)) - | (PreviousValue::MustNotExist, None) - | (PreviousValue::ExistingMustMatch(_), None) => {} + | (PreviousValue::MustNotExist | PreviousValue::ExistingMustMatch(_), None) => {} (PreviousValue::MustExist, None) => { let expected = Target::Peeled(store.object_hash.null()); let full_name = change.name(); @@ -141,8 +140,10 @@ impl<'s, 'p> Transaction<'s, 'p> { }); } } - (PreviousValue::MustExistAndMatch(previous), Some(existing)) - | (PreviousValue::ExistingMustMatch(previous), Some(existing)) => { + ( + PreviousValue::MustExistAndMatch(previous) | PreviousValue::ExistingMustMatch(previous), + Some(existing), + ) => { if *previous != existing.target { let actual = existing.target.clone(); let expected = previous.to_owned(); @@ -180,11 +181,11 @@ impl<'s, 'p> Transaction<'s, 'p> { }; if (is_effective && !direct_to_packed_refs) || is_symbolic { - let mut lock = lock.take().map(Ok).unwrap_or_else(obtain_lock)?; + let mut lock = lock.take().map_or_else(obtain_lock, Ok)?; lock.with_mut(|file| match new { Target::Peeled(oid) => write!(file, "{oid}"), - Target::Symbolic(name) => write!(file, "ref: {}", name.0), + Target::Symbolic(name) => writeln!(file, "ref: {}", name.0), })?; Some(lock.close()?) } else { @@ -249,7 +250,7 @@ impl<'s, 'p> Transaction<'s, 'p> { { let mut edits_for_packed_transaction = Vec::<RefEdit>::new(); let mut needs_packed_refs_lookups = false; - for edit in updates.iter() { + for edit in &updates { let log_mode = match edit.update.change { Change::Update { log: LogChange { mode, .. }, diff --git a/vendor/gix-ref/src/store/general/handle/find.rs b/vendor/gix-ref/src/store/general/handle/find.rs index 9792b9b7d..2f11f1755 100644 --- a/vendor/gix-ref/src/store/general/handle/find.rs +++ b/vendor/gix-ref/src/store/general/handle/find.rs @@ -5,7 +5,7 @@ use crate::{store, PartialNameRef, Reference}; mod error { use std::convert::Infallible; - /// The error returned by [crate::file::Store::find_loose()]. + /// The error returned by [`crate::file::Store::find_loose()`]. #[derive(Debug, thiserror::Error)] #[allow(missing_docs)] pub enum Error { diff --git a/vendor/gix-ref/src/store/general/init.rs b/vendor/gix-ref/src/store/general/init.rs index a9112c0a6..52c582a7a 100644 --- a/vendor/gix-ref/src/store/general/init.rs +++ b/vendor/gix-ref/src/store/general/init.rs @@ -3,7 +3,7 @@ use std::path::PathBuf; use crate::store::WriteReflog; mod error { - /// The error returned by [crate::Store::at()]. + /// The error returned by [`crate::Store::at()`]. #[derive(Debug, thiserror::Error)] #[allow(missing_docs)] pub enum Error { diff --git a/vendor/gix-ref/src/store/packed/transaction.rs b/vendor/gix-ref/src/store/packed/transaction.rs index 26cc84b9b..e487e218c 100644 --- a/vendor/gix-ref/src/store/packed/transaction.rs +++ b/vendor/gix-ref/src/store/packed/transaction.rs @@ -68,7 +68,7 @@ impl packed::Transaction { .collect(); let mut buf = Vec::new(); - for edit in edits.iter_mut() { + for edit in &mut edits { if let Change::Update { new: Target::Peeled(new), .. |