Skip to main content

delete_ref

Function delete_ref 

Source
pub fn delete_ref(db: &Db, name: &str) -> Result<bool, Error>
Expand description

Delete a ref. Returns false when there was no live ref by that name.

Written as a deleted: true version rather than a real delete for one mechanical reason and one design one: Db::delete refuses reserved collections outright, and keeping the version chain intact means the ref’s movement history survives its deletion.

Unlike a tag, the NAME IS FREE AGAIN — set_ref will happily recreate it. That is the whole difference between the two kinds, and it is safe here because a ref never promised to stay put, so nothing downstream is entitled to assume a past reference to it still resolves the same way.