Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW
◌ CI pending Fintan Halpenny committed 7 months ago
commit fd6d73d989708fb0bd4c58ab4ba738cfa9cfe6f9
parent 84dfa5b23d707bdf031138525e68f37a83121f63
1 pending (1 total) View logs
1 file changed +6 -6
modified crates/radicle-remote-helper/src/push.rs
@@ -503,12 +503,12 @@ fn patch_base(
///
/// We choose to push a temporary reference to storage, which gets deleted on
/// [`Drop::drop`].
-
struct TempRef<'a> {
+
struct TempPatchRef<'a> {
    stored: &'a storage::git::Repository,
    reference: git::Namespaced<'a>,
}

-
impl<'a> TempRef<'a> {
+
impl<'a> TempPatchRef<'a> {
    fn new(stored: &'a storage::git::Repository, head: &git::Oid, nid: &NodeId) -> Self {
        let reference = git::refs::storage::staging::patch(nid, *head);
        Self { stored, reference }
@@ -519,13 +519,13 @@ impl<'a> TempRef<'a> {
    }
}

-
impl<'a> Drop for TempRef<'a> {
+
impl<'a> Drop for TempPatchRef<'a> {
    fn drop(&mut self) {
        if let Err(err) = self
            .stored
            .raw()
            .find_reference(&self.reference)
-
            .map(|mut r| r.delete())
+
            .and_then(|mut r| r.delete())
        {
            eprintln!(
                "{} Failed to delete temporary reference {} in storage: {err}",
@@ -554,7 +554,7 @@ fn patch_open<G>(
where
    G: crypto::signature::Signer<crypto::Signature>,
{
-
    let temp = TempRef::new(stored, head, nid);
+
    let temp = TempPatchRef::new(stored, head, nid);
    temp.push(head, opts.verbosity)?;
    let base = patch_base(head, &opts, stored)?;

@@ -687,7 +687,7 @@ where
        return Err(Error::NotFound(patch_id));
    };

-
    let temp = TempRef::new(stored, head, nid);
+
    let temp = TempPatchRef::new(stored, head, nid);
    temp.push(head, opts.verbosity)?;

    let base = patch_base(head, &opts, stored)?;