diff --git a/src/hg-data.c b/src/hg-data.c index e45631a54..f9faf5d59 100644 --- a/src/hg-data.c +++ b/src/hg-data.c @@ -53,8 +53,7 @@ void hg_file_load(struct hg_file *result, const struct hg_object_id *oid) if (is_empty_hg_file(oid)) return; - ensure_notes(&files_meta); - note = get_note_hg(&files_meta, oid); + note = get_files_meta(oid); if (note) { if (oid_object_info_extended( the_repository, note, &oi, diff --git a/src/hg-data.h b/src/hg-data.h index 13128e990..7361be44b 100644 --- a/src/hg-data.h +++ b/src/hg-data.h @@ -91,7 +91,6 @@ void hg_file_store(struct hg_file *file, struct hg_file *reference); int add_hg2git(const struct hg_object_id *oid, const struct object_id *note_oid); int add_files_meta(const struct hg_object_id *oid, const struct object_id *note_oid); -const struct object_id *get_note_hg(struct notes_tree *notes, - const struct hg_object_id *oid); +const struct object_id *get_files_meta(const struct hg_object_id *oid); #endif diff --git a/src/libcinnabar.rs b/src/libcinnabar.rs index 387dca433..7aa4bfa69 100644 --- a/src/libcinnabar.rs +++ b/src/libcinnabar.rs @@ -183,6 +183,11 @@ pub unsafe extern "C" fn get_note_hg( cinnabar_get_note(notes, &git_oid.into()) } +#[no_mangle] +pub unsafe extern "C" fn get_files_meta(oid: *const hg_object_id) -> *const object_id { + get_note_hg(&mut files_meta.0, oid) +} + unsafe fn add_note_hg( notes: *mut cinnabar_notes_tree, oid: *const hg_object_id,