From 022912a59b9713b4d8b8158bf374468099dea3eb Mon Sep 17 00:00:00 2001 From: One <43485962+c-git@users.noreply.github.com> Date: Sun, 5 Nov 2023 16:30:30 -0500 Subject: [PATCH] Supply name for signature as it fails in CI --- tests/utils/git_commands.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/utils/git_commands.rs b/tests/utils/git_commands.rs index 678e35c..037473e 100644 --- a/tests/utils/git_commands.rs +++ b/tests/utils/git_commands.rs @@ -1,7 +1,7 @@ use std::path::Path; use anyhow::bail; -use git2::Repository; +use git2::{Repository, Signature}; pub fn init>(path: P) -> anyhow::Result { Ok(git2::Repository::init(path)?) @@ -21,7 +21,7 @@ pub fn commit(repo: &Repository, msg: &str) -> anyhow::Result<()> { // Source: Example of how to do init https://github.com/rust-lang/git2-rs/blob/fd4d7c7c840788ccdc535889a42532c3d57d338d/examples/init.rs#L94-L95 // Second Source: Needed to see how to find parent https://github.dev/rust-lang/git2-rs/blob/master/examples/add.rs - let sig = repo.signature()?; + let sig = Signature::now("test_user", "test_email")?; let mut index = repo.index()?; if index.is_empty() { bail!("Empty index found. Unable to commit");