Don't accept Darcs MRs with more than one patch bundle file

This commit is contained in:
fr33domlover 2020-08-17 09:01:14 +00:00
parent cb11ea6447
commit 32adee0a75
2 changed files with 16 additions and 0 deletions

View file

@ -689,6 +689,10 @@ createTicketC (Entity pidUser personUser) sharerUser summary audience ticket muT
case ebundle of
Left _ -> throwE "MR bundle specified as a URI"
Right (hBundle, bundle) -> checkBundle hBundle bundle
case (typ, diffs) of
(PatchMediaTypeDarcs, _ :| _ : _) ->
throwE "More than one Darcs patch bundle provided"
_ -> return ()
return (branch, typ, diffs)
where
checkBranch
@ -1477,6 +1481,10 @@ offerTicketC (Entity pidUser personUser) sharerUser summary audience ticket uTar
case ebundle of
Left _ -> throwE "MR bundle specified as a URI"
Right (hBundle, bundle) -> checkBundle hBundle bundle
case (typ, diffs) of
(PatchMediaTypeDarcs, _ :| _ : _) ->
throwE "More than one Darcs patch bundle provided"
_ -> return ()
return (branch, typ, diffs)
where
checkBranch h lu = do

View file

@ -154,6 +154,10 @@ checkOfferTicket author ticket uTarget = do
case ebundle of
Left _ -> throwE "MR bundle specified as a URI"
Right (hBundle, bundle) -> checkBundle hBundle bundle
case (typ, diffs) of
(PatchMediaTypeDarcs, _ :| _ : _) ->
throwE "More than one Darcs patch bundle provided"
_ -> return ()
return (branch, typ, diffs)
where
checkBranch h lu = do
@ -611,6 +615,10 @@ checkCreateTicket author ticket muTarget = do
case ebundle of
Left _ -> throwE "MR bundle specified as a URI"
Right (hBundle, bundle) -> checkBundle hBundle bundle
case (typ, patches) of
(PatchMediaTypeDarcs, _ :| _ : _) ->
throwE "More than one Darcs patch bundle provided"
_ -> return ()
return (branch, typ, patches)
where
checkBranch