Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
test: set name and email for repository fixture
Fintan Halpenny committed 0 years ago
commit f5fa84fac6736d2e31ec20c9b844ff12e6414d14
parent 59a1021410a28b635d86cde34da75766204f2f7e
1 file changed +9 -6
modified radicle/src/test/fixtures.rs
@@ -81,12 +81,15 @@ pub fn project<P: AsRef<Path>, G: Signer>(
/// Creates a regular repository at the given path with a couple of commits.
pub fn repository<P: AsRef<Path>>(path: P) -> (git2::Repository, git2::Oid) {
    let repo = git2::Repository::init(path).unwrap();
-
    let sig = git2::Signature::new(
-
        "anonymous",
-
        "anonymous@radicle.xyz",
-
        &git2::Time::new(RADICLE_EPOCH, 0),
-
    )
-
    .unwrap();
+
    let user_name = "anonymous";
+
    let user_email = "anonymous@radicle.xyz";
+
    {
+
        let mut config = repo.config().unwrap();
+
        config.set_str("user.name", user_name).unwrap();
+
        config.set_str("user.email", user_email).unwrap();
+
    }
+
    let sig =
+
        git2::Signature::new(user_name, user_email, &git2::Time::new(RADICLE_EPOCH, 0)).unwrap();
    let head = git::initial_commit(&repo, &sig).unwrap();
    let tree = git::write_tree(Path::new("README"), "Hello World!\n".as_bytes(), &repo).unwrap();
    let oid = {