We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 80086cb + 7ebcd01 commit 0782ffcCopy full SHA for 0782ffc
src/tests/repo_utils.rs
@@ -15,7 +15,11 @@ impl Context {
15
/// Prepare a fresh git repository with an initial commit and a file.
16
pub fn prepare_repo() -> (Context, PathBuf) {
17
let dir = tempfile::tempdir().unwrap();
18
- let repo = git2::Repository::init(dir.path()).unwrap();
+ let repo = git2::Repository::init_opts(
19
+ dir.path(),
20
+ git2::RepositoryInitOptions::new().initial_head("master"),
21
+ )
22
+ .unwrap();
23
become_author(&repo, "nobody", "[email protected]");
24
25
let path = PathBuf::from("test-file.txt");
0 commit comments