From 5ccd74aa8a041d5bd6f2c1cad5f71dd5204c1782 Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Sat, 13 May 2023 23:16:32 +0200 Subject: [PATCH] Use `tmp` namespace for temporary refs during push The `refs/tmp` namespace is used by Git for the purpose of storing temporary refs. We use it here instead of `refs/patch` to indicate that the refs can be safely deleted. --- radicle/src/git.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radicle/src/git.rs b/radicle/src/git.rs index 5e31db57..a2475046 100644 --- a/radicle/src/git.rs +++ b/radicle/src/git.rs @@ -237,11 +237,11 @@ pub mod refs { pub mod staging { use super::*; - /// Where patches are pushed initially, when they don't have an object-id yet. + /// Where patch heads are pushed initially, before patch creation. /// This is a short-lived reference, which is deleted after the patch has been opened. /// The `` is the commit proposed in the patch. /// - /// `refs/namespaces//refs/patch/heads/` + /// `refs/namespaces//refs/tmp/heads/` /// pub fn patch<'a>(remote: &RemoteId, oid: impl Into) -> Namespaced<'a> { // SAFETY: OIDs are valid reference names and valid path component. @@ -250,7 +250,7 @@ pub mod refs { #[allow(clippy::unwrap_used)] let oid = Component::from_refstr(oid).unwrap(); - Qualified::from_components(component!("patch"), component!("heads"), Some(oid)) + Qualified::from_components(component!("tmp"), component!("heads"), Some(oid)) .with_namespace(remote.into()) } }