Skip to content

Commit

Permalink
Supply name for signature as it fails in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
c-git committed Nov 5, 2023
1 parent d94daa6 commit 022912a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/utils/git_commands.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::path::Path;

use anyhow::bail;
use git2::Repository;
use git2::{Repository, Signature};

pub fn init<P: AsRef<Path>>(path: P) -> anyhow::Result<Repository> {
Ok(git2::Repository::init(path)?)
Expand All @@ -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");
Expand Down

0 comments on commit 022912a

Please sign in to comment.