git_backend: stop writing tree ids to proto

We have been writing conflicted tree ids to the `jj:trees` commit
header since 4d426049 (just over a year ago) and we have been able to
read them from there since the same commit. This patch updates the
write path so we no longer redundantly write the trees to the proto
storage.
This commit is contained in:
Martin von Zweigbergk 2025-03-22 23:39:30 -07:00
parent f7b14beacc
commit b8ca9ae806

View file

@ -646,11 +646,8 @@ fn serialize_extras(commit: &Commit) -> Vec<u8> {
change_id: commit.change_id.to_bytes(),
..Default::default()
};
if let MergedTreeId::Merge(tree_ids) = &commit.root_tree {
if matches!(commit.root_tree, MergedTreeId::Merge(_)) {
proto.uses_tree_conflict_format = true;
if !tree_ids.is_resolved() {
proto.root_tree = tree_ids.iter().map(|r| r.to_bytes()).collect();
}
}
for predecessor in &commit.predecessors {
proto.predecessors.push(predecessor.to_bytes());