Skip to content

Commit 173b852

Browse files
committed
Default to alice when missing an LCA, I.e. use a two-way diff rather than diff from the empty branch
1 parent d427395 commit 173b852

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Share/BackgroundJobs/Diffs/CausalDiffs.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,10 @@ maybeComputeAndStoreCausalDiff authZReceipt unisonRuntime (CausalDiffInfo {fromC
106106
authZReceipt
107107
(fromCodebase, fromRuntime, fromCausalId)
108108
(toCodebase, toRuntime, toCausalId)
109-
bestCommonAncestorCausalId
109+
-- This is a little strange. At the moment, if we don't have a proper LCA we
110+
-- revert to a two-way diff. The other option would be to diff both from an empty
111+
-- branch, but that's not typically what the user meant.
112+
-- If this assumption no longer holds true in the future, feel free to change it
113+
-- to be more explicit about which diff we're calculating.
114+
(Just $ fromMaybe fromCausalId bestCommonAncestorCausalId)
110115
pure True

0 commit comments

Comments
 (0)