Skip to content

Commit

Permalink
Avoid using STORE global in remote_helper_tags_list
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Nov 26, 2023
1 parent 52349ff commit 0e80b7a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3610,10 +3610,7 @@ pub fn main() {
std::process::exit(ret);
}

fn remote_helper_tags_list(mut stdout: impl Write) {
Lazy::force(&INIT_CINNABAR_2);
let _lock = HELPER_LOCK.lock().unwrap();
let store = unsafe { &STORE };
fn remote_helper_tags_list(store: &Store, mut stdout: impl Write) {
let tags = store.get_tags();
let tags = tags
.iter()
Expand Down Expand Up @@ -4533,7 +4530,8 @@ fn git_remote_hg(remote: OsString, mut url: OsString) -> Result<c_int, String> {
};
if url.scheme() == "tags" {
assert!(!for_push);
remote_helper_tags_list(&mut stdout);
Lazy::force(&INIT_CINNABAR_2);
remote_helper_tags_list(unsafe { &STORE }, &mut stdout);
} else {
info = Some(remote_helper_repo_list(
unsafe { HAS_GIT_REPO.then_some(&STORE) },
Expand Down

0 comments on commit 0e80b7a

Please sign in to comment.