forked from StrafesNET/asset-tool
tweak history gen
This commit is contained in:
parent
0d1692f253
commit
f23be6f445
@ -942,8 +942,11 @@ async fn write_commit(config:WriteCommitConfig,b:Result<AResult<(AssetVersion,De
|
|||||||
let sig=git2::Signature::new(config.git_committer_name.as_str(),config.git_committer_email.as_str(),&git2::Time::new(date.timestamp(),0)).unwrap();
|
let sig=git2::Signature::new(config.git_committer_name.as_str(),config.git_committer_email.as_str(),&git2::Time::new(date.timestamp(),0)).unwrap();
|
||||||
let tree_id={
|
let tree_id={
|
||||||
let mut tree_index = repo.index()?;
|
let mut tree_index = repo.index()?;
|
||||||
tree_index.add_all([config.output_folder.as_path()].iter(),git2::IndexAddOption::DEFAULT,None)?;
|
match tree_index.add_all(std::iter::once(config.output_folder.as_path()),git2::IndexAddOption::DEFAULT,None){
|
||||||
match tree_index.update_all([config.output_folder.as_path()].iter(),None){
|
Ok(_)=>(),
|
||||||
|
Err(e)=>println!("tree_index.add_all error: {}",e),
|
||||||
|
}
|
||||||
|
match tree_index.update_all(std::iter::once(config.output_folder.as_path()),None){
|
||||||
Ok(_)=>(),
|
Ok(_)=>(),
|
||||||
Err(e)=>println!("tree_index.update_all error: {}",e),
|
Err(e)=>println!("tree_index.update_all error: {}",e),
|
||||||
}
|
}
|
||||||
@ -961,7 +964,7 @@ async fn write_commit(config:WriteCommitConfig,b:Result<AResult<(AssetVersion,De
|
|||||||
//test tree against commit tree to see if there is any changes
|
//test tree against commit tree to see if there is any changes
|
||||||
let commit_tree=commit.tree()?;
|
let commit_tree=commit.tree()?;
|
||||||
let diff=repo.diff_tree_to_tree(Some(&commit_tree),Some(&tree),None)?;
|
let diff=repo.diff_tree_to_tree(Some(&commit_tree),Some(&tree),None)?;
|
||||||
if diff.deltas().count()==0{
|
if diff.get_delta(0).is_none(){
|
||||||
println!("no changes");
|
println!("no changes");
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user