From 4d92bf5c07eee11749d43a8f3242e04ae25fc550 Mon Sep 17 00:00:00 2001 From: bors Date: Wed, 14 Oct 2020 02:04:31 +0000 Subject: [PATCH 1/2] Auto merge of #8778 - ehuss:update-git2, r=alexcrichton Update git2. Closes #8517 Closes #8588 Closes #8352 Closes #4777 Closes #8746 I only added a test for one of these. I can add for the others if you want. --- Cargo.toml | 4 ++-- tests/testsuite/new.rs | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index aa6be2f3d65..a36245c86ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/tests/testsuite/new.rs b/tests/testsuite/new.rs index 32dbafe9814..6ea777eeaa8 100644 --- a/tests/testsuite/new.rs +++ b/tests/testsuite/new.rs @@ -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"); +} From bb66e0fd7e12865b196a2fc8bf3b0a3152ef6652 Mon Sep 17 00:00:00 2001 From: bors Date: Mon, 12 Oct 2020 18:49:55 +0000 Subject: [PATCH 2/2] Auto merge of #8772 - ehuss:update-toml, r=alexcrichton Update toml dependency --- Cargo.toml | 2 +- tests/testsuite/build.rs | 4 ++-- tests/testsuite/config.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a36245c86ee..0ee08906038 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,7 +60,7 @@ strip-ansi-escapes = "0.1.0" tar = { version = "0.4.26", default-features = false } tempfile = "3.0" termcolor = "1.1" -toml = "0.5.3" +toml = "0.5.7" unicode-xid = "0.2.0" url = "2.0" walkdir = "2.2" diff --git a/tests/testsuite/build.rs b/tests/testsuite/build.rs index ac556520ab8..268ddbdf36f 100644 --- a/tests/testsuite/build.rs +++ b/tests/testsuite/build.rs @@ -196,7 +196,7 @@ Caused by: could not parse input as TOML Caused by: - invalid number at line 3 column 23 + invalid TOML value, did you mean to use a quoted string? at line 3 column 23 ", ) .run(); @@ -216,7 +216,7 @@ Caused by: could not parse input as TOML Caused by: - invalid number at line 1 column 5 + invalid TOML value, did you mean to use a quoted string? at line 1 column 5 ", ) .run(); diff --git a/tests/testsuite/config.rs b/tests/testsuite/config.rs index aa6976910df..0723d3cad97 100644 --- a/tests/testsuite/config.rs +++ b/tests/testsuite/config.rs @@ -794,7 +794,7 @@ expected a list, but found a integer for `l3` in [..]/.cargo/config", assert_error( config.get::("bad-env").unwrap_err(), "error in environment variable `CARGO_BAD_ENV`: \ - could not parse TOML list: invalid number at line 1 column 8", + could not parse TOML list: invalid TOML value, did you mean to use a quoted string? at line 1 column 8", ); // Try some other sequence-like types.