Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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");
}