diff --git a/src/main.rs b/src/main.rs index adf5e7c..ab2e9c9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -752,6 +752,10 @@ async fn write_commit(config:WriteCommitConfig,b:Resultparents.push(reference.peel_to_commit()?), + Ok(reference)=>{ + let commit=reference.peel_to_commit()?; + + //test tree against commit tree to see if there is any changes + let commit_tree=commit.tree()?; + let diff=repo.diff_tree_to_tree(Some(&commit_tree),Some(&tree),None)?; + if diff.deltas().count()==0{ + println!("no changes"); + return Ok(()); + } + + parents.push(commit); + }, Err(e)=>println!("repo head error {:?}",e), };