ok/jj
1
0
Fork 0
forked from mirrors/jj

evolog: use predecessor_ids() where commit object isn't needed

This commit is contained in:
Yuya Nishihara 2024-09-05 12:22:32 +09:00
parent 25819dd1c9
commit c3ed3e3781

View file

@ -142,10 +142,11 @@ pub(crate) fn cmd_evolog(
if !args.no_graph { if !args.no_graph {
let mut graph = get_graphlog(graph_style, formatter.raw()); let mut graph = get_graphlog(graph_style, formatter.raw());
for commit in commits { for commit in commits {
let mut edges = vec![]; let edges = commit
for predecessor in commit.predecessors() { .predecessor_ids()
edges.push(Edge::Direct(predecessor?.id().clone())); .iter()
} .map(|id| Edge::Direct(id.clone()))
.collect_vec();
let graph_width = || graph.width(commit.id(), &edges); let graph_width = || graph.width(commit.id(), &edges);
let mut buffer = vec![]; let mut buffer = vec![];
with_content_format.write_graph_text( with_content_format.write_graph_text(