From 293a76948fb2d72a85c5902e8ecca681fd5db9ff Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Sat, 29 Apr 2023 11:43:35 +0200 Subject: [PATCH] Update `SignedRefs::save` function * Remove redundant `remote` parameter * Fix commit message and remove redundant remote --- radicle/src/storage/git.rs | 2 +- radicle/src/storage/refs.rs | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/radicle/src/storage/git.rs b/radicle/src/storage/git.rs index 736668bb..2d2976b9 100644 --- a/radicle/src/storage/git.rs +++ b/radicle/src/storage/git.rs @@ -595,7 +595,7 @@ impl WriteRepository for Repository { let refs = self.references_of(remote)?; let signed = refs.signed(signer)?; - signed.save(remote, self)?; + signed.save(self)?; Ok(signed) } diff --git a/radicle/src/storage/refs.rs b/radicle/src/storage/refs.rs index 330569ac..3d9d9f09 100644 --- a/radicle/src/storage/refs.rs +++ b/radicle/src/storage/refs.rs @@ -281,13 +281,9 @@ impl SignedRefs { /// Save the signed refs to disk. /// This creates a new commit on the signed refs branch, and updates the branch pointer. - pub fn save( - &self, - // TODO: This should be part of the signed refs. - remote: &RemoteId, - repo: &S, - ) -> Result { + pub fn save(&self, repo: &S) -> Result { let sigref = &SIGREFS_BRANCH; + let remote = &self.id; let parent = match repo.reference(remote, sigref) { Ok(r) => Some(r.peel_to_commit()?), Err(git_ext::Error::Git(e)) if git_ext::is_not_found_err(&e) => None, @@ -323,7 +319,7 @@ impl SignedRefs { Some(&sigref), &author, &author, - &format!("Update signature for {remote}\n"), + "Update signed refs\n", &tree, &parent.iter().collect::>(), );