rename reorg

This commit is contained in:
Joey Hess 2019-07-31 15:04:37 -04:00
parent f4e8ab969e
commit 78983d1e33
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

34
Lfs.hs
View file

@ -175,6 +175,22 @@ instance ToJSON OperationParams where
instance FromJSON OperationParams
data Verification = Verification
{ verification_oid :: SHA256
, verification_size :: Integer
}
deriving (Generic, Show)
instance ToJSON Verification where
toJSON = genericToJSON verifyBodyOptions
toEncoding = genericToEncoding verifyBodyOptions
instance FromJSON Verification where
parseJSON = genericParseJSON verifyBodyOptions
verifyBodyOptions :: Options
verifyBodyOptions = stripFieldPrefix defaultOptions
data GitRef = GitRef
{ name :: T.Text }
deriving (Generic, Show)
@ -252,25 +268,9 @@ uploadOperation op content oid size =
mkverifyreq' r = addLfsJsonHeaders $ r
{ method = "POST"
, requestBody = RequestBodyLBS $ encode $
VerifyBody oid size
Verification oid size
}
data VerifyBody = VerifyBody
{ verifybody_oid :: SHA256
, verifybody_size :: Integer
}
deriving (Generic, Show)
instance ToJSON VerifyBody where
toJSON = genericToJSON verifyBodyOptions
toEncoding = genericToEncoding verifyBodyOptions
instance FromJSON VerifyBody where
parseJSON = genericParseJSON verifyBodyOptions
verifyBodyOptions :: Options
verifyBodyOptions = stripFieldPrefix defaultOptions
operationParamsRequest :: OperationParams -> Maybe Request
operationParamsRequest ps = do
r <- parseRequest (T.unpack (href ps))