step fifty: data, delete refs

This commit is contained in:
Gonçalo Valério 2020-11-28 21:48:38 +00:00
parent 2e9b5f6a4d
commit 8f60af7aa4
1 changed files with 5 additions and 0 deletions

View File

@ -73,6 +73,11 @@ pub fn get_ref(reference: String, deref: bool) -> RefValue {
return get_ref_internal(reference, deref).1;
}
pub fn delete_ref(reference: String, deref: bool) {
let ref_to_del = get_ref_internal(reference, deref).0;
fs::remove_file(format!("{}/{}", RGIT_DIR, ref_to_del)).unwrap();
}
pub fn iter_refs(prefix: &str, deref: bool) -> Vec<(String, RefValue)> {
let mut refs: Vec<(String, RefValue)> = vec![];