mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-21 10:30:41 +08:00
After a fetch is performed, `set_head` is called, which essentially updates the default branch based on the canonical reference rule for that branch. Later, `set_canonical_refs` is called, which originally could be the empty set of rules. This would mean that the event for the default branch would never be emitted. The approach taken here is to always use the default branch rule if there are no rules set in the identity document. Unfortunately, this ends up in computing the default branch twice, due to `set_head`. Another approach is to use the result of `set_head` to update the set of `UpdatedCanonicalRefs`, to prevent the need for defaulting to the default branch rule. However, this does not prevent the double counting as soon as the rules are added to the identity document, since the default branch rule will then be synthesised into the rule set.