maint: fix up default remote branch handling

This commit is contained in:
Matthew Ryan Dillon 2021-10-26 12:49:56 -07:00
parent d1b7619077
commit 85fb10d737
3 changed files with 6 additions and 6 deletions

2
Cargo.lock generated
View file

@ -1,5 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "autocfg"
version = "1.0.1"

View file

@ -1,6 +1,6 @@
[package]
name = "gwar"
version = "0.0.1"
version = "0.1.0"
authors = ["Matthew Dillon <matthewrdillon@gmail.com>"]
edition = "2018"

View file

@ -78,11 +78,7 @@ impl Workspace {
fetch_opts.remote_callbacks(callbacks);
let mut builder = RepoBuilder::new();
builder
.fetch_options(fetch_opts)
.remote_create(move |repo, _name, url| {
repo.remote_with_fetch(&self.origin.name, url, "+refs/*:refs/*")
});
builder.fetch_options(fetch_opts);
builder
}
@ -96,6 +92,8 @@ impl Workspace {
)
.expect(&format!("couldn't clone repo: {}", repo_name));
repo.remote_rename("origin", &self.origin.name).unwrap();
repo
}