@ -130,7 +130,7 @@ impl Branch {
let id = cobj.id();
// root has no deps
let is_root = cobj.deps().len() == 0;
let is_root = cobj.is_root();
//debug_println!(" deps: {:?}", cobj.deps());
// check if this commit object is present in their_heads
@ -379,6 +379,11 @@ impl Object {
}
pub fn is_root(&self) -> bool {
self.deps().len() == 0
//TODO: add && sdeps().len() == 0 && self.acks().len() == 0 && self.nacks().len() == 0
pub fn root(&self) -> &Block {
self.blocks.last().unwrap()