Skip to content

Commit 10bea05

Browse files
authored
Merge pull request #47 from AlexanderStein/fix-test
common: fix initial branch name
2 parents 62bec61 + 73439c2 commit 10bea05

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/common/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::io::{self, Write};
55
use std::path::{Path, PathBuf};
66
use std::process::{Command, Output};
77

8-
use git2::{BranchType, IndexAddOption, ObjectType, Oid, Repository};
8+
use git2::{BranchType, IndexAddOption, ObjectType, Oid, Repository, RepositoryInitOptions};
99

1010
pub fn generate_path_to_repo<S>(repo_name: S) -> PathBuf
1111
where
@@ -36,7 +36,9 @@ where
3636
fs::remove_dir_all(&path_to_repo).ok();
3737
fs::create_dir_all(&path_to_repo).unwrap();
3838

39-
let repo = match Repository::init(path_to_repo) {
39+
let mut options = RepositoryInitOptions::new();
40+
options.initial_head("master");
41+
let repo = match Repository::init_opts(path_to_repo, &options) {
4042
Ok(repo) => repo,
4143
Err(err) => panic!("failed to init repo: {}", err),
4244
};

0 commit comments

Comments
 (0)