This commit is contained in:
Kiril Videlov 2024-04-27 23:43:25 +02:00
parent d65f723ec0
commit 6ff0d551eb
No known key found for this signature in database

View File

@ -129,11 +129,14 @@ mod tests {
let mut index = repo.index().unwrap(); let mut index = repo.index().unwrap();
index.add_path(&PathBuf::from("foo.txt")).unwrap(); index.add_path(&PathBuf::from("foo.txt")).unwrap();
let oid = index.write_tree().unwrap(); let oid = index.write_tree().unwrap();
let name = "Your Name";
let email = "your.email@example.com";
let signature = git2::Signature::now(name, email).unwrap();
let commit_id = repo let commit_id = repo
.commit( .commit(
Some("HEAD"), Some("HEAD"),
&repo.signature().unwrap(), &signature,
&repo.signature().unwrap(), &signature,
"initial commit", "initial commit",
&repo.find_tree(oid).unwrap(), &repo.find_tree(oid).unwrap(),
&[], &[],