Skip to content

Commit

Permalink
Auto merge of #8780 - ehuss:git2-1.48, r=alexcrichton
Browse files Browse the repository at this point in the history
[beta] backport libgit2

This is a backport of #8778 to beta. The reason is that #8517 has started showing up again on rust-lang/rust CI, and I think it is important to fix that.

This is risky, because this is a large update with a lot of untested changes. However, I think the risk is worth it to fix #8517.

This also includes #8772 to get Cargo's CI to pass. I think the risk for that is low (the [changes](toml-rs/toml-rs@0.5.6...0.5.7) are small).  However, I'd be fine with just modifying the tests to pass if you want to drop it.
  • Loading branch information
bors committed Oct 14, 2020
2 parents 75615f8 + bb66e0f commit 65cbdd2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ expected a list, but found a integer for `l3` in [..]/.cargo/config",
assert_error(
config.get::<L>("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.
Expand Down
23 changes: 23 additions & 0 deletions tests/testsuite/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

0 comments on commit 65cbdd2

Please sign in to comment.