Skip to content

Commit

Permalink
nar: throw error if there are collisions during unpacking
Browse files Browse the repository at this point in the history
  • Loading branch information
sandydoo committed Oct 4, 2024
1 parent d35aa18 commit 67ea0d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hnix-store-nar/src/System/Nix/Nar/Streamer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ streamNarIOWithOptions opts effs basePath yield = do
if Nar.optUseCaseHack opts
then undoCaseHack f
else f
in Map.insert name f acc
in
case Map.insertLookupWithKey (\_ n _ -> n) name f acc of
(Nothing, newMap) -> newMap
(Just conflict, _) -> error $ "File name collision between " ++ (path </> name) ++ " and " ++ (path </> conflict)
) Map.empty fs
yield $ strs ["type", "directory"]
forM_ (Map.toAscList entries) $ \(unhacked, original) -> do
Expand Down

0 comments on commit 67ea0d0

Please sign in to comment.