diff --git a/src/main.rs b/src/main.rs index 64183f0..adf5e7c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -756,25 +756,22 @@ async fn write_commit(config:WriteCommitConfig,b:Resultrepo.commit( - Some("HEAD"),//update_ref - &sig,//author - &sig,//commiter - &format!("v{}", asset_version.assetVersionNumber),//message - &tree,//tree (basically files) - &[&reference.peel_to_commit()?],//parents - )?, - Err(_)=>repo.commit( - Some("HEAD"),//update_ref - &sig,//author - &sig,//commiter - &format!("v{}", asset_version.assetVersionNumber),//message - &tree,//tree (basically files) - &[],//parents - )?, + Ok(reference)=>parents.push(reference.peel_to_commit()?), + Err(e)=>println!("repo head error {:?}",e), }; + repo.commit( + Some("HEAD"),//update_ref + &sig,//author + &sig,//commiter + &format!("v{}", asset_version.assetVersionNumber),//message + &tree,//tree (basically files) + parents.iter().collect::>>().as_slice(),//parents + )?; + //commit Ok(()) }