diff --git a/src/cinnabar-fast-import.c b/src/cinnabar-fast-import.c index accdea869..a9d112675 100644 --- a/src/cinnabar-fast-import.c +++ b/src/cinnabar-fast-import.c @@ -161,8 +161,6 @@ static void init(void) atexit(locked_rollback); } -extern void dump_ref_updates(void); - static void cleanup(void) { if (!initialized) @@ -182,7 +180,6 @@ static void cleanup(void) NULL); commit_shallow_file(the_repository, &shallow_lock); } - dump_ref_updates(); } unkeep_all_packs(); diff --git a/src/cinnabar-helper.c b/src/cinnabar-helper.c index 74da70882..a34b7ef93 100644 --- a/src/cinnabar-helper.c +++ b/src/cinnabar-helper.c @@ -473,8 +473,6 @@ unsigned int replace_map_tablesize(void) extern void init_metadata(struct commit *c); -void dump_ref_updates(void); - extern void reset_changeset_heads(void); extern void reset_manifest_heads(void); @@ -485,8 +483,6 @@ void do_reload(struct object_id *oid) done_cinnabar(); hashmap_init(&git_tree_cache, oid_map_entry_cmp, NULL, 0); - dump_ref_updates(); - reset_replace_map(); if (oid) { if (!is_null_oid(oid)) { diff --git a/src/main.rs b/src/main.rs index ae7ebf47f..27d16727a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -188,8 +188,7 @@ extern "C" { static REF_UPDATES: Lazy, CommitId>>> = Lazy::new(|| Mutex::new(HashMap::new())); -#[no_mangle] -unsafe extern "C" fn dump_ref_updates() { +fn dump_ref_updates() { let mut transaction = RefTransaction::new().unwrap(); for (refname, oid) in REF_UPDATES.lock().unwrap().drain() { let refname = OsStr::from_bytes(&refname); @@ -4579,6 +4578,8 @@ fn git_remote_hg(remote: OsString, mut url: OsString) -> Result { _ => panic!("unknown command: {}", cmd.as_bstr()), } } + // See comment in remote_helper_tags_list. + dump_ref_updates(); Ok(0) }