Skip to content

Commit 65cbdd2

Browse files
committed
Auto merge of #8780 - ehuss:git2-1.48, r=alexcrichton
[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.
2 parents 75615f8 + bb66e0f commit 65cbdd2

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pretty_env_logger = { version = "0.4", optional = true }
3232
anyhow = "1.0"
3333
filetime = "0.2.9"
3434
flate2 = { version = "1.0.3", default-features = false, features = ["zlib"] }
35-
git2 = "0.13.5"
35+
git2 = "0.13.12"
3636
git2-curl = "0.14.0"
3737
glob = "0.3.0"
3838
hex = "0.4"
@@ -44,7 +44,7 @@ jobserver = "0.1.21"
4444
lazycell = "1.2.0"
4545
libc = "0.2"
4646
log = "0.4.6"
47-
libgit2-sys = "0.12.7"
47+
libgit2-sys = "0.12.14"
4848
memchr = "2.1.3"
4949
num_cpus = "1.0"
5050
opener = "0.4"
@@ -60,7 +60,7 @@ strip-ansi-escapes = "0.1.0"
6060
tar = { version = "0.4.26", default-features = false }
6161
tempfile = "3.0"
6262
termcolor = "1.1"
63-
toml = "0.5.3"
63+
toml = "0.5.7"
6464
unicode-xid = "0.2.0"
6565
url = "2.0"
6666
walkdir = "2.2"

tests/testsuite/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Caused by:
196196
could not parse input as TOML
197197
198198
Caused by:
199-
invalid number at line 3 column 23
199+
invalid TOML value, did you mean to use a quoted string? at line 3 column 23
200200
",
201201
)
202202
.run();
@@ -216,7 +216,7 @@ Caused by:
216216
could not parse input as TOML
217217
218218
Caused by:
219-
invalid number at line 1 column 5
219+
invalid TOML value, did you mean to use a quoted string? at line 1 column 5
220220
",
221221
)
222222
.run();

tests/testsuite/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ expected a list, but found a integer for `l3` in [..]/.cargo/config",
794794
assert_error(
795795
config.get::<L>("bad-env").unwrap_err(),
796796
"error in environment variable `CARGO_BAD_ENV`: \
797-
could not parse TOML list: invalid number at line 1 column 8",
797+
could not parse TOML list: invalid TOML value, did you mean to use a quoted string? at line 1 column 8",
798798
);
799799

800800
// Try some other sequence-like types.

tests/testsuite/new.rs

+23
Original file line numberDiff line numberDiff line change
@@ -602,3 +602,26 @@ If you need a crate name to not match the directory name, consider using --name
602602
)
603603
.run();
604604
}
605+
606+
#[cargo_test]
607+
fn git_default_branch() {
608+
// Check for init.defaultBranch support.
609+
create_empty_gitconfig();
610+
cargo_process("new foo").env("USER", "foo").run();
611+
let repo = git2::Repository::open(paths::root().join("foo")).unwrap();
612+
let head = repo.find_reference("HEAD").unwrap();
613+
assert_eq!(head.symbolic_target().unwrap(), "refs/heads/master");
614+
615+
fs::write(
616+
paths::home().join(".gitconfig"),
617+
r#"
618+
[init]
619+
defaultBranch = hello
620+
"#,
621+
)
622+
.unwrap();
623+
cargo_process("new bar").env("USER", "foo").run();
624+
let repo = git2::Repository::open(paths::root().join("bar")).unwrap();
625+
let head = repo.find_reference("HEAD").unwrap();
626+
assert_eq!(head.symbolic_target().unwrap(), "refs/heads/hello");
627+
}

0 commit comments

Comments
 (0)