mirror of
https://github.com/rust-lang/cargo
synced 2024-09-13 21:11:44 +00:00
Update git2.
This commit is contained in:
parent
31e1f1f786
commit
0be75d2edc
|
@ -32,7 +32,7 @@ pretty_env_logger = { version = "0.4", optional = true }
|
|||
anyhow = "1.0"
|
||||
filetime = "0.2.9"
|
||||
flate2 = { version = "1.0.3", default-features = false, features = ["zlib"] }
|
||||
git2 = "0.13.5"
|
||||
git2 = "0.13.12"
|
||||
git2-curl = "0.14.0"
|
||||
glob = "0.3.0"
|
||||
hex = "0.4"
|
||||
|
@ -44,7 +44,7 @@ jobserver = "0.1.21"
|
|||
lazycell = "1.2.0"
|
||||
libc = "0.2"
|
||||
log = "0.4.6"
|
||||
libgit2-sys = "0.12.7"
|
||||
libgit2-sys = "0.12.14"
|
||||
memchr = "2.1.3"
|
||||
num_cpus = "1.0"
|
||||
opener = "0.4"
|
||||
|
|
|
@ -602,3 +602,26 @@ If you need a crate name to not match the directory name, consider using --name
|
|||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn git_default_branch() {
|
||||
// Check for init.defaultBranch support.
|
||||
create_empty_gitconfig();
|
||||
cargo_process("new foo").env("USER", "foo").run();
|
||||
let repo = git2::Repository::open(paths::root().join("foo")).unwrap();
|
||||
let head = repo.find_reference("HEAD").unwrap();
|
||||
assert_eq!(head.symbolic_target().unwrap(), "refs/heads/master");
|
||||
|
||||
fs::write(
|
||||
paths::home().join(".gitconfig"),
|
||||
r#"
|
||||
[init]
|
||||
defaultBranch = hello
|
||||
"#,
|
||||
)
|
||||
.unwrap();
|
||||
cargo_process("new bar").env("USER", "foo").run();
|
||||
let repo = git2::Repository::open(paths::root().join("bar")).unwrap();
|
||||
let head = repo.find_reference("HEAD").unwrap();
|
||||
assert_eq!(head.symbolic_target().unwrap(), "refs/heads/hello");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue