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.
This commit is contained in:
parent
7d68df86d1
commit
5ccd74aa8a
|
|
@ -237,11 +237,11 @@ pub mod refs {
|
||||||
pub mod staging {
|
pub mod staging {
|
||||||
use super::*;
|
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.
|
/// This is a short-lived reference, which is deleted after the patch has been opened.
|
||||||
/// The `<oid>` is the commit proposed in the patch.
|
/// The `<oid>` is the commit proposed in the patch.
|
||||||
///
|
///
|
||||||
/// `refs/namespaces/<remote>/refs/patch/heads/<oid>`
|
/// `refs/namespaces/<remote>/refs/tmp/heads/<oid>`
|
||||||
///
|
///
|
||||||
pub fn patch<'a>(remote: &RemoteId, oid: impl Into<Oid>) -> Namespaced<'a> {
|
pub fn patch<'a>(remote: &RemoteId, oid: impl Into<Oid>) -> Namespaced<'a> {
|
||||||
// SAFETY: OIDs are valid reference names and valid path component.
|
// SAFETY: OIDs are valid reference names and valid path component.
|
||||||
|
|
@ -250,7 +250,7 @@ pub mod refs {
|
||||||
#[allow(clippy::unwrap_used)]
|
#[allow(clippy::unwrap_used)]
|
||||||
let oid = Component::from_refstr(oid).unwrap();
|
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())
|
.with_namespace(remote.into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue