Open samuela opened 4 years ago
I believe you can make a read-only equivalent of mirror with:
git2::build::RepoBuilder::new()
.bare(true)
.remote_create(|repo,name,url| repo.remote_with_fetch(name, url, "+refs/*:refs/*"))
The only difference is that pushes won't use the default mirror semantics (hence why I said read-only). But you may be able to use Repository::remote_add_push
to make that work, too?
Thanks @afranchuk !
Is there a way to do the equivalent of
git clone --mirror <url>
with git2-rs? It seems like bare cloning (https://docs.rs/git2/0.11.0/git2/build/struct.RepoBuilder.html#method.bare) is supported but I'm not able to find anything for mirroring.