Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/UnisonShare/BranchDiffState.elm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type DiffError
, constructorName2 : FQN
}
| StrayConstructor { culprit : DiffErrorCulprit, constructorName : FQN }
| LibFoundAtUnexpectedPath
| LibFoundAtUnexpectedPath { path : FQN }
| UnknownError


Expand Down Expand Up @@ -74,6 +74,10 @@ decodeDiffError =
makeStrayConstructor culprit ctor =
StrayConstructor
{ culprit = culprit, constructorName = ctor }

makeLibFoundAtUnexpectedPath path =
LibFoundAtUnexpectedPath
{ path = path }
in
Decode.oneOf
[ whenTagIs "impossibleError"
Expand Down Expand Up @@ -102,7 +106,7 @@ decodeDiffError =
(Decode.field "constructorName" FQN.decode)
)
, whenTagIs "libFoundAtUnexpectedPath"
(Decode.succeed LibFoundAtUnexpectedPath)
(Decode.map makeLibFoundAtUnexpectedPath (Decode.field "path" FQN.decode))
, Decode.succeed UnknownError
]

Expand Down
5 changes: 3 additions & 2 deletions src/UnisonShare/Page/ProjectContributionChangesPage.elm
Original file line number Diff line number Diff line change
Expand Up @@ -995,9 +995,10 @@ view appContext projectRef contribution model =
, text " branch."
]

BranchDiffState.LibFoundAtUnexpectedPath ->
BranchDiffState.LibFoundAtUnexpectedPath { path } ->
Just
[ text "lib namespace found at unexpected path."
[ text "lib namespace found at unexpected path: "
, FQN.view path
]

_ ->
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/TestHelpers/Data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ type DiffErrorDetails =
tag: "strayConstructor";
oldOrNewBranch: DiffErrorCulprit;
constructorName: string;
}
| {
tag: "libFoundAtUnexpectedPath";
path: string;
};

type ContributionDiffConfig =
Expand Down
Loading