use crate::submodules::Entry;
pub fn print_default(entries: &[Entry]) {
for e in entries {
let middle = e.status.problem.as_deref().unwrap_or(&e.status.branch);
println!("{} {} {}", e.path.display(), middle, e.status.ok());
}
}
pub fn print_verbose(entries: &[Entry]) {
for e in entries {
let p = e.path.display();
let s = &e.status;
if let Some(reason) = &s.problem {
println!("{p}\tRESULT\t{reason}\tfalse");
continue;
}
println!("{p}\tcommitted\t{}", s.committed);
println!("{p}\tall-commits-pushed\t{}", s.all_commits_pushed);
println!("{p}\tbranches-have-remote\t{}", s.branches_have_remote);
println!("{p}\tnot-behind-remote\t{}", s.not_behind_remote);
println!("{p}\tcorrect-branch\t{}", s.correct_branch);
println!("{p}\tRESULT\t{}\t{}", s.branch, s.ok());
}
}
pub fn all_ok(entries: &[Entry]) -> bool {
entries.iter().all(|e| e.status.ok())
}